/changename - How?
#1

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
Reply
#2

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

Setplayername
Reply
#4

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

Edit your script then u can change the commands.....
Reply
#6

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
Reply
#7

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;
}
Reply
#8

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

how?
Reply
#10

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)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)