08.03.2014, 15:14
first of all you have to define pname:
now if you want to check if the name the player wrote is not used then use:
pawn Код:
new pname[MAX_PLAYER_NAME];
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;
}