HElp For Change name
#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


Messages In This Thread
HElp For Change name - by alishvasis - 08.03.2014, 14:02
Re: HElp For Change name - by XK - 08.03.2014, 15:14
Re: HElp For Change name - by alishvasis - 08.03.2014, 16:44
Re: HElp For Change name - by XK - 08.03.2014, 17:06
Re: HElp For Change name - by alishvasis - 08.03.2014, 17:10
Re: HElp For Change name - by XK - 08.03.2014, 17:12
Re: HElp For Change name - by alishvasis - 08.03.2014, 17:28
Re: HElp For Change name - by XK - 08.03.2014, 17:33
Re: HElp For Change name - by alishvasis - 08.03.2014, 17:43

Forum Jump:


Users browsing this thread: 1 Guest(s)