Results 1 to 7 of 7

Thread: Renaming people if they have same name as admins, if they don't have same GUID

  1. #1
    ... connecting Uppah's Avatar
    Join Date
    Sep 2020
    Posts
    4
    Thanks
    3
    Thanked 2 Times in 2 Posts

    Renaming people if they have same name as admins, if they don't have same GUID

    I'm currently working with Eaeliboy's "Multiple unknown soldier renamer". Here I'm trying to make it impossible for people to use our names if they don't have the same GUID as us.

    But I just can't get the following script to work:

    PHP Code:
    //This script was made by Earliboy
    //You are free to use or edit this file.
    //Do not forget to credit me.
    //Any help you get at: xfire: earliboy skype: earliboy

    //Adding new rename:
    //level.unkNames[level.unkNames.size] = "NAME";
    //Example: level.unkNames[level.unkNames.size] = "US Guest #000";

    //Adding a new name player should renamed to:
    //level.unkRename[level.unkRename.size] = "NAME";
    //Example: level.unkRename[level.unkRename.size] = "Unknown Player#" + num;

    init()
    {
        
    level.adminNames = [];
        
    level.adminNames[level.adminNames.size] = "Uppah";
        
    level.adminNames[level.adminNames.size] = "sdrifle#Uppah";
        
    level.adminNames[level.adminNames.size] = "sdrifle # Uppah";
        
    level.adminNames[level.adminNames.size] = "loser | Uppah";
        
    level.adminNames[level.adminNames.size] = "[UdSSR] Uppah";
        
    level.adminNames[level.adminNames.size] = "Nerty_";
        
    level.adminNames[level.adminNames.size] = "sdrifle.com#Nerty";
        
    level.adminNames[level.adminNames.size] = "sdr.yt#Nerty";
        
    level.adminNames[level.adminNames.size] = "n3rty";
        
    level.adminNames[level.adminNames.size] = "n e r t y";
        
    level.adminNames[level.adminNames.size] = "Nerty";
        
    level.adminNames[level.adminNames.size] = "``Air Savage ! :>";
        
    level.adminNames[level.adminNames.size] = "Mr Savage !";
        
    level.adminNames[level.adminNames.size] = "too high for this shit :>";
        
    level.adminNames[level.adminNames.size] = "savage the director";
        
        
    /**
         * 884750 = Uppah      | 249816 = Wolft
         * 892561 = Nerty      | 956379 = Maeva
         * 796907 = Savage     | 726220 = Mehdi
         * 705330 = Blaadje    | 782511 = Blitz
         * 880271 = Miki       | 805143 = Matt
         * 881431 = Vuzqii     | 726901 = redwhite
         * 962969 = pablito    | 924561 = Hannie
         * 750925 = kRis       | 217313 = T-REX
         * 748044 = Haaveilen  | 743819 = Dano
         * 732746 = F4RE       | 802977 = Rocc
         * 922866 = admin lies |
         */
        
    level.adminGUIDs = []
        
    level.adminGUIDs[level.adminGUIDs.size] = 884750;
        
    level.adminGUIDs[level.adminGUIDs.size] = 892561;
        
    level.adminGUIDs[level.adminGUIDs.size] = 796907;
        
    level.adminGUIDs[level.adminGUIDs.size] = 705330;
        
    level.adminGUIDs[level.adminGUIDs.size] = 249816;
        
    level.adminGUIDs[level.adminGUIDs.size] = 956379;
        
    level.adminGUIDs[level.adminGUIDs.size] = 726220;
        
    level.adminGUIDs[level.adminGUIDs.size] = 782511;
        
    level.adminGUIDs[level.adminGUIDs.size] = 880271;
        
    level.adminGUIDs[level.adminGUIDs.size] = 805143;
        
    level.adminGUIDs[level.adminGUIDs.size] = 881431;
        
    level.adminGUIDs[level.adminGUIDs.size] = 726901;
        
    level.adminGUIDs[level.adminGUIDs.size] = 962969;
        
    level.adminGUIDs[level.adminGUIDs.size] = 924561;
        
    level.adminGUIDs[level.adminGUIDs.size] = 750925;
        
    level.adminGUIDs[level.adminGUIDs.size] = 217313;
        
    level.adminGUIDs[level.adminGUIDs.size] = 748044;
        
    level.adminGUIDs[level.adminGUIDs.size] = 743819;
        
    level.adminGUIDs[level.adminGUIDs.size] = 732746;
        
    level.adminGUIDs[level.adminGUIDs.size] = 802977;
        
    level.adminGUIDs[level.adminGUIDs.size] = 922866;

        
    thread waitConnect();
    }

    waitConnect()
    {
        for(;;)
        {
            
    level waittill("connecting"player);
            
    player thread checkMe();
        }
    }

    checkMe()
    {
        for(
    0level.adminNames.sizei++)
        {
            if(
    self.name == level.adminNames[i])
            {
                for(
    0level.adminGUIDs.sizej++)
                    {
                        if(
    self getGuid() == level.adminGUIDs[j]){
                            
    self setClientCvar("name"level.adminNames[i]);
                            break;
                        }

                        if(
    == level.adminGUIDs.size && self getGuid() != level.adminGUIDs[j]){
                            
    sdname "^8sdrifle.com^3#^9F@n^1:^7" randomInt(9999);
                            
    self setClientCvar("name"sdname);
                        }
                    }
            }
        }

    Regards,
    Uppah
    Last edited by Uppah; 7th September 2020 at 11:18.

  2. The Following User Says Thank You to Uppah For This Useful Post:

    kung foo man (8th September 2020)

  3. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,626
    Thanks
    17
    Thanked 967 Times in 605 Posts
    PHP Code:
    checkme()
    {
        
    adminname undefined;
        for(
    0level.adminnames.sizei++)
        {
            if(
    level.adminnames[i] == self.name)
            {
                
    adminname i;
                break;
            }
        }
        if(!
    isdefined(adminname))
            return;

        
    admin undefined;
        for(
    0level.adminguids.sizei++)
        {
            if(
    level.adminguids[i] == self getguid())
                
    admin i;
        }

        if(!
    isdefined(admin))
        {
            
    self setclientcvar("name""^8sdrifle.com^3#^9F@n^1:^7" randomInt(9999));
        }
        else if(
    admin != adminname)
        {
            
    self setclientcvar("name"level.adminnames[admin]);
        }

    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

    Sending me a private message makes me want to help you LESS.

  4. The Following 2 Users Say Thank You to IzNoGoD For This Useful Post:

    kung foo man (8th September 2020),Uppah (8th September 2020)

  5. #3
    ... connecting Uppah's Avatar
    Join Date
    Sep 2020
    Posts
    4
    Thanks
    3
    Thanked 2 Times in 2 Posts
    ******* script compile error *******
    bad syntax: (file 'maps/mp/gametypes/_unkrn.gsc', line 47)
    level.adminGUIDs[level.adminGUIDs.size] = 884750;

  6. #4
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,626
    Thanks
    17
    Thanked 967 Times in 605 Posts
    Line 46, add a ; at the end.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

    Sending me a private message makes me want to help you LESS.

  7. The Following 2 Users Say Thank You to IzNoGoD For This Useful Post:

    kung foo man (8th September 2020),Uppah (8th September 2020)

  8. #5
    ... connecting Uppah's Avatar
    Join Date
    Sep 2020
    Posts
    4
    Thanks
    3
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by IzNoGoD View Post
    Line 46, add a ; at the end.
    Works! Thank you so much!

    Another question:
    If I want it to check if a player change a name into the names in the adminNames array all the time - from when they connect till they disconnect. How do I tackle that problem?

    Again, thank you so much for your help!

  9. #6
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    426
    Thanks
    78
    Thanked 102 Times in 86 Posts
    if you using libcod:
    PHP Code:
    /* your callback script (callbacksetup) */
    CodeCallback_UserInfoChanged(num)
    {
        
    name self get_userinfo("name");
        if (
    self.name != name && !self isBot())
        {
            
    self.name name;
            return 
    self thread scripts\_names::checkme();
        }
        
        
    self clientuserinfochanged();

    This is not very good code, it is best to rework the renaming functions with the return of the result (yes / no) in case of success (good nickname) / failure (nickname is not allowed) -> then update / do not update userinfo

    if you not using libcod, create loop for checking name != oldname with delay: 0.5 - 1 sec.
    Or insert checking-code into exist loop.
    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

  10. The Following 2 Users Say Thank You to maxdamage99 For This Useful Post:

    kung foo man (11th September 2020),Uppah (9th September 2020)

  11. #7
    ... connecting Uppah's Avatar
    Join Date
    Sep 2020
    Posts
    4
    Thanks
    3
    Thanked 2 Times in 2 Posts
    Yeah, I'm using libcod.

    I totally forgot about the callback script! I actually used it for when I did anti-namesteal.
    I'll go play a little around with it. Thank you pointing me in the right direction, I really appreciate it!

  12. The Following User Says Thank You to Uppah For This Useful Post:

    kung foo man (11th September 2020)

Posting Permissions

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