/setname help
#1

I've tryed to make an /setname command, it worked but I want it to save the data. Like I've done 10 missions, in the new file it must save those data either. If someone could make that would be awesome.

path to userfiles: /scriptfiles/ServerData/Players/

Current code:
pawn Код:
COMMAND:changename(playerid,params[])
{
    new OtherPlayer12, Msg12[170], Name12[24], Message12[150], OtherPlayerName12[24];
    SendAdminText(playerid,"/changename", params);
    if (APlayerData[playerid][PlayerLevel] < 5) return SendClientMessage(playerid, 0xFFFFFFFF, "[ERROR]: You don't have access!");
    else if(sscanf(params, "rs[170]", OtherPlayer12, Message12)) return SendClientMessage(playerid,0xFFFFFFFF, "SYNTAX: /changename <name/id> <newname>");
    GetPlayerName(playerid, Name12, sizeof(Name12));
    GetPlayerName(OtherPlayer12, OtherPlayerName12, sizeof(OtherPlayerName12));
    format(Msg12, sizeof(Msg12), "{FF6600}%s {FFFFFF}has changed {FF6600}%s {FFFFFF}his name to: {FF6600}%s", Name12, OtherPlayerName12, Message12);
    SendClientMessageToAll(0xFFFFFFFF, Msg12);
    SetPlayerName(OtherPlayer12, Message12);
    return 1;
}
Could someone do that for me?

PS. If u need some specific data ask me here.
Reply
#2

Rename the file where the player's data is being saved in.
Reply
#3

How?
Reply
#4

Which file-writing system are you using?
Reply
#5

dutils.inc


pawn Код:
stock frename(oldname[],newname[]) {
    if (!fexist(oldname)) return false;
    fremove(newname);
    if (!fcopy(oldname,newname)) return false;
    fremove(oldname);
    return true;
Reply
#6

Updated that last post. How to use that?
Reply
#7

Anyone?
Reply
#8

I don't understand, what are you trying to do?

Save the new name to player's userfile or rename the userfile?
Reply
#9

renaming it.
Reply
#10

Show the code where you save things to userfile.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)