Results 1 to 3 of 3

Thread: Change renamer: Error!

  1. #1
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts

    Change renamer: Error!

    Hello Guys, i looked for name renamer by earliboy ( http://killtube.org/showthread.php?1...oldier-renamer )

    I have added on my TDM.gsc this:

    Code:
    main()
    {
    	level.callbackStartGameType = ::Callback_StartGameType;
    	level.callbackPlayerConnect = ::Callback_PlayerConnect;
    	level.callbackPlayerDisconnect = ::Callback_PlayerDisconnect;
    	level.callbackPlayerDamage = ::Callback_PlayerDamage;
    	level.callbackPlayerKilled = ::Callback_PlayerKilled;
    	maps\mp\gametypes\_callbacksetup::SetupCallbacks();
    	thread maps\mp\gametypes\_badname::init();   // Here it will be called the script
    
    	level.autoassign = ::menuAutoAssign;
    	level.allies = ::menuAllies;
    	level.axis = ::menuAxis;
    	level.spectator = ::menuSpectator;
    	level.weapon = ::menuWeapon;
    	level.endgameconfirmed = ::endMap;
    }
    and here is my _badname.gsc :
    Code:
    init()
    {
        level.unkNames = [];
        level.unkNames[level.unkNames.size] = "Unknown Soldier";
        level.unkNames[level.unkNames.size] = "UnnamedPlayer";
        
        level.unkRename = [];
        level.unkRename[level.unkRename.size] = "MWCoD2-Player";
        
        thread waitConnect();
    }
    
    waitConnect()
    {
        for(;;)
        {
            level waittill("connecting", player);
            player thread checkMe();
        }
    }
    
    checkMe()
    {
        for(i = 0; i < level.unkNames.size; i++)
        {
            if(isSubstr(self.name, level.unkNames[i]))
            {
                name = level.unkRename[randomInt(level.unkRename.size)];
                self setClientCvar("name",name + randomIntRange(999));
            }
        }
    }
    And this is my error:

    Code:
    ******* script runtime error *******
    parameter 2 does not exist: (file 'maps/mp/gametypes/_badname.gsc', line 29)
                self setClientCvar("name",name + randomIntRange(999));
                                                 *
    called from:
    (file 'maps/mp/gametypes/_badname.gsc', line 18)
            player thread checkMe();
                          *
    started from:
    (file 'maps/mp/gametypes/_badname.gsc', line 17)
            level waittill("connecting", player);
                  *
    ************************************
    Does anyone know how to fix? I never worked on scripts how like this so i can't fix the script.

    Thank you for reply's!

  2. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Look@the docs for the function you used

    http://www.zeroy.com/script/math/randomintrange.htm

    Now, allow me to copy-paste your error:
    parameter 2 does not exist.

    Good luck, and try some stuff yourself next time.

  3. #3
    Private First Class Earliboy's Avatar
    Join Date
    Nov 2012
    Location
    Germany
    Posts
    130
    Thanks
    5
    Thanked 88 Times in 61 Posts
    Change RandomIntRange to randomInt(999)

    I had it to Range because on my script i use numbers from 10-50. Just change it and it will work!
    No ... No ... this is not possible .......

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

    Loveboy (15th July 2013)

Posting Permissions

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