Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Save Player's Names to File

  1. #1
    ... connecting
    Join Date
    Feb 2013
    Posts
    8
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Save Player's Names to File

    Hi, I would like to know if it is possible to to save a player's name(s) in a file linked to their guid number?
    For example, whenever someone changes their name, their new name is saved into the file on a new line, but only if it has not already been written.
    (guid).txt
    (inside file)-> name1
    name2
    name3
    etc...

    I have read this post & thread: http://killtube.org/showthread.php?6...ull=1#post3069 to get feel of how to read and write files but I do not know how to read or write multiple lines. I know that a player's name can be retrieved from the variable "self.name" but how would I go about checking the name against what is written in the file to prevent duplicate writes?
    Thanks!

  2. #2
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    One name should be pretty easy to save, just reserve the first line for it.

    But multiple names are bad:
    - longer load/save-time (could be limited, by limiting the number of saved aliases (which makes it less useful again))
    - workload of IO (input/output) could lag the gameserver
    - possibly loss of saved stats

    I wouldn't bet in such a system, when there is a much easier and more performant solution: B3 working on MySQL
    timescale 0.01

  3. The Following User Says Thank You to kung foo man For This Useful Post:

    Crestfallen (11th March 2013)

  4. #3
    Private First Class Earliboy's Avatar
    Join Date
    Nov 2012
    Location
    Germany
    Posts
    130
    Thanks
    5
    Thanked 88 Times in 61 Posts
    Yes, B3 would be more usefull. Just install Echelon too and you can see the full alias list.
    No ... No ... this is not possible .......

  5. The Following User Says Thank You to Earliboy For This Useful Post:

    Crestfallen (11th March 2013)

  6. #4
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by Earliboy View Post
    Yes, B3 would be more usefull. Just install Echelon too and you can see the full alias list.
    B3: http://www.bigbrotherbot.net/
    Echelon: http://www.bigbrotherbot.net/echelon/home

  7. #5
    ... connecting
    Join Date
    Feb 2013
    Posts
    8
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Okay, thanks guys! I'll look more into both B3 and Echelon
    I have another question, is there a way to force hipshots? Such as a way to disable toggleads so that players can not aim down their sights? Thanks!

  8. #6
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Hey, you are welcome!

    You can write in callback_playerdamage:

    PHP Code:
    if (attacker playerAds() > 0)
    {
        
    attacker iprintlnbold("only hipshots / no aim!");
        return;

    Disable the aim "for real" is not possible i guess, besides patching the function out (i would do that for you, if you want to rent a server ).
    timescale 0.01

  9. The Following User Says Thank You to kung foo man For This Useful Post:

    Crestfallen (11th March 2013)

  10. #7
    ... connecting
    Join Date
    Feb 2013
    Posts
    8
    Thanks
    6
    Thanked 0 Times in 0 Posts
    This works as well thanks kung foo man!
    Oh, how much per slot and where are they located?

  11. #8
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Hey, its 0.50€/Slot, like 16 Slots = 8€/Month

    With free: B3, Fast-Download, CoD-Extension (MySQL inside CoDScript, get/set-Velocity etc.)

    Edit: forgot to mention, location is in Germany.
    timescale 0.01

  12. #9
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by kung foo man View Post
    Hey, you are welcome!

    You can write in callback_playerdamage:

    PHP Code:
    if (attacker playerAds() > 0)
    {
        
    attacker iprintlnbold("only hipshots / no aim!");
        return;

    Disable the aim "for real" is not possible i guess, besides patching the function out (i would do that for you, if you want to rent a server ).
    You can disable aimDownSight in the weapon files by changing the value from 1 to 0. This works for all weapons.

  13. The Following User Says Thank You to Tally For This Useful Post:

    kung foo man (11th March 2013)

  14. #10
    ... connecting
    Join Date
    Feb 2013
    Posts
    8
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Tally View Post
    Hey, its 0.50€/Slot, like 16 Slots = 8€/Month

    With free: B3, Fast-Download, CoD-Extension (MySQL inside CoDScript, get/set-Velocity etc.)

    Edit: forgot to mention, location is in Germany.
    Hmm, well I live in the U.S so my ping wouldn't be so great

    Quote Originally Posted by Tally View Post
    You can disable aimDownSight in the weapon files by changing the value from 1 to 0. This works for all weapons.
    How can I toggle this between 0 and 1, though, through a cvar in a script?
    Last edited by Crestfallen; 12th March 2013 at 00:01.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •