Results 1 to 10 of 12

Thread: Rename

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Private
    Join Date
    Jun 2013
    Posts
    70
    Thanks
    20
    Thanked 32 Times in 26 Posts
    save this code in a file call it for eg rename.gsc then create a folder in your mod called scripts and put it in there

    Monitor()
    {
    while(true)
    {
    if(getcvar("rename") != "")
    {
    string = getCvar("rename");
    array = strTok(string, ":");

    if (array.size == 2)
    {
    players = getentarray("player", "classname");
    for(i = 0; i < players.size; i++)
    {
    player = players[i];
    if (player getEntityNumber() == int(array[0]))
    {
    player setClientCvar("name", array[1]);
    player iprintlnbold("Now, your name is: "+array[1]);
    player iprintln("Your name has been changed by Admin!");
    }
    }
    }
    setCvar("rename", "");
    }
    }
    }
    next open the gamemode file or files you wanna use and paste this line at the botton of the Callback_StartGameType() function

    thread scripts\rename::Monitor();
    this should work for now but the are other and better ways i would recommend a event based solution
    Last edited by vanfreddy; 3rd December 2020 at 10:59.

Posting Permissions

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