01.08.2010, 18:10
(
Последний раз редактировалось scott1; 02.08.2010 в 00:19.
)
Hi all, i make an command /rename into french, but if the name already exist name change or i put condition id exist we don't change name.
Please help me
pawn Код:
if(strcmp(cmd, "/changernom", true) == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new tmpp[256];
tmpp = strtok(cmdtext, idx);
if(!strlen(tmpp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /changernom [playerid] [nouveau nom (Prenom_Nom)]");
return 1;
}
giveplayerid = strval(tmpp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /changernom [playerid] [nouveau nom (Prenom_Nom)]");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "users/%s.ini", tmp);
if(fexist(string))
{
SendClientMessage(playerid, COLOR_YELLOW, "Ce pseudo existe dйjа.");
return 1;
}
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 1337)
{
if(IsPlayerConnected(giveplayerid))
{
new namestring = strfind(tmp, "_", true);
if(namestring == -1)
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /changernom [playerid] [nouveau nom (Prenom_Nom)]");
return 1;
}
else
{
SetPlayerName(giveplayerid, tmp);
format(string,sizeof(string),"users/%s.ini",giveplayer);
fremove(string);
format(string, sizeof(string), "AdmCMD: %s(%i) a changй votre nom en %s", sendername, playerid, tmp);
SendClientMessage(giveplayerid, COLOR_DBLUE, string);
format(string, sizeof(string), "AdmCMD: Vous avez changer le nom de l'id %i en %s", giveplayerid, tmp);
SendClientMessage(playerid, COLOR_DBLUE, string);
format(string, 256, "AdmWarning: %s а changй le nom de %s en %s.", sendername,giveplayer, tmp);
ABroadCast(COLOR_YELLOW,string,1);
SauvegardeCompte(playerid);
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Ce joueur n'est pas connectй!");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Vous n'кtes pas autorisй a utiliser cette commande!");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Vous devez йtre connectй!");
}
return 1;
}
Please help me