HElp For Change name
#1

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

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

Tnx And How To Delet Current Nick Name?
Reply
#4

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

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

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

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

you did something wrong,try to paste it again
Reply
#9

Note Give Wrong Just Not Work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)