SA-MP Forums Archive
/changename - How? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /changename - How? (/showthread.php?tid=319163)



/changename - How? - L0zaix - 18.02.2012

how to make change name?
i search around the SAMP Forums but i only found strcmp/dcmd
i searching for /changename in zcmd and sscanf2.

Please help me guys


Re: /changename - How? - RBTDM - 18.02.2012

do /changename [player id] Name
eg: /changename 2 RBTDM


Re: /changename - How? - milanosie - 18.02.2012

Setplayername


Re: /changename - How? - L0zaix - 18.02.2012

the question is how can i rename there files i use dini and how can i do that?


Re: /changename - How? - RBTDM - 18.02.2012

Edit your script then u can change the commands.....


Re: /changename - How? - milanosie - 18.02.2012

Rbtm. Those awnsers are useless..
U need to copy the files to the new name obviously, like setplayername. The input thre will also be the output for the new file


Re: /changename - How? - L0zaix - 18.02.2012

it work. but when i reconnect with that new nick name again i get a register dialog instead of login.
codes.

pawn Код:
CMD:changename(playerid, params[])
{
    new name[MAX_PLAYER_NAME],
        id,
        pname[MAX_PLAYER_NAME],
        string[128],
        nick[20];
    if(PlayerInfo[playerid][Admin] > 5)
    {
        if(sscanf(params, "us[20]", id, nick)) return SendClientMessage(playerid, COLOR_RED, "SYNTAX: /changename <playername/id> <nickname>");
        if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid-Playerid!");
        if(IsPlayerNPC(id)) return SendClientMessage(playerid, COLOR_RED, "You cannot change NPC Bot's name!");
        GetPlayerName(id, name, sizeof(name));
        GetPlayerName(playerid, pname, sizeof(pname));
        SetPlayerName(id, nick);
        format(string, sizeof(string), "Administrator %s(ID:%d) has set %s(ID:%d)'s name to %s", pname, playerid, name, id, nick);
        SendClientMessageToAll(COLOR_RED, string);
        format(string, sizeof(string), "You set %s(ID:%d)'s name to %s", name, id, nick);
        SendClientMessage(playerid, COLOR_GREEN, string);
        format(string, sizeof(string), "Administrator %s(ID:%d) has set your name to %s", pname, playerid, nick);
        SendClientMessage(id, COLOR_RED, string);
        format(string, sizeof(string), "ADMIN-SPEC: %s has used /changename", pname);
        SentMessageToAdmins(COLOR_GREY, string);
    }
    else return SendClientMessage(playerid, COLOR_RED, "You must be Administrator Level 5 or higher to use this command!");
    return 1;
}



Re: /changename - How? - Twisted_Insane - 18.02.2012

Where do you save the nickname?
You gotta save the new name aswell!


Re: /changename - How? - L0zaix - 18.02.2012

how?


Re: /changename - How? - park4bmx - 18.02.2012

ok in order to change the player name and also keep the save data
you will need to make sure that u store the players data into variales
then change their name to whatever they want and just creat a new file with that name and save the stored date into the variables
and just remove the old name file (if you want)