SA-MP Forums Archive
HElp For Change name - 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: HElp For Change name (/showthread.php?tid=499496)



HElp For Change name - alishvasis - 08.03.2014

Hi All i Make Change name System.. How To Set My Change name System To If Acount Maked Ago.. Get To Player Maessege You Cant Change To this Name.Becuse This Name Is Maked .
This Is My Dini System. Any One Can Set This ? TnX
Код:
format(file, sizeof(file), savefolder,strlower(pname));
if(!dini_Exists(file)){
 SetPlayerScore(playerid, dini_Int(file, "Score")); // This describes where to load the score
SetPlayerCash(playerid, dini_Int(file, "Money"));
 return 1;}



Re: HElp For Change name - XK - 08.03.2014

first of all you have to define pname:
pawn Код:
new pname[MAX_PLAYER_NAME];
now if you want to check if the name the player wrote is not used then use:
pawn Код:
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
        SendClientMessage(playerid, COLOR_GREY, "USAGE: /changename [name]");
    return 1;
}
format(file,sizeof(file),"%s.ini",tmp);
if(!dini_Exists(file))
{
        SetPlayerScore(playerid, dini_Int(file, "Score")); // This describes where to load the score
        SetPlayerCash(playerid, dini_Int(file, "Money"));
        return 1;
}
else if(dini_Exists(file))
{
        SendClientMessage(playerid, -1, "This name is already registered,please choose another name");
        return 1;
}



Re: HElp For Change name - alishvasis - 08.03.2014

Tnx And How To Delet Current Nick Name?


Re: HElp For Change name - XK - 08.03.2014

if it's dialog then it should be : put them under the dialog thing
pawn Код:
format(file,sizeof(file),"%s.ini",inputtext);
if(!dini_Exists(file))
{
        format(file2,sizeof(file2),"%s.ini",pname);
        dini_Remove(file2);
        SetPlayerScore(playerid, dini_Int(file, "Score")); // This describes where to load the score
        SetPlayerCash(playerid, dini_Int(file, "Money"));
        SetPlayerName(playerid, inputtext);
        return 1;
}
else if(dini_Exists(file))
{
        SendClientMessage(playerid, -1, "This name is already registered,please choose another name");
        return 1;
}
dini _remove deletes his current name,and i set it to change his name to the name he wanted


Re: HElp For Change name - alishvasis - 08.03.2014

Yes Thanks But How To Delet Current Nick Name ? (Last Nick name?) Where Put Delet?


Re: HElp For Change name - XK - 08.03.2014

i already did,it automaticly deletes his old name and his old file,and makes a new file for his new name


Re: HElp For Change name - alishvasis - 08.03.2014

I Test Not Working... I Keep All Of Nick Names .. SAy To Me This Name Is Maked !!!!


Re: HElp For Change name - XK - 08.03.2014

you did something wrong,try to paste it again


Re: HElp For Change name - alishvasis - 08.03.2014

Note Give Wrong Just Not Work