08.05.2010, 10:27
Why the old account dont gets deleted if i change someones name ?
Quote:
if(strcmp(cmd, "/changename", true) == 0) { GetPlayerName(playerid, sendername, sizeof(sendername)); new tmpp[256]; tmpp = strtok(cmdtext, idx); if(!strlen(tmpp)) { SendClientMessage(playerid, COLOR_DBLUE, "Correct SYNTAX: /changename [playerid] [new nick]"); return 1; } giveplayerid = strval(tmpp); tmp = strtok(cmdtext, idx); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] >= 4) { if(IsPlayerConnected(giveplayerid)) { SetPlayerName(giveplayerid, tmp); if(fexist(tmpp)) format(tmpp,64,"%s.ini",giveplayer); fremove(tmpp); format(string, sizeof(string), "AdmCMD: %s(%i) has changed Your name to %s", sendername, playerid, tmp); SendClientMessage(giveplayerid, COLOR_DBLUE, string); format(string, sizeof(string), "AdmCMD: You have changed ID %i's name to %s", giveplayerid, tmp); SendClientMessage(playerid, COLOR_DBLUE, string); format(string, 256, "AdmWarning: %s has changed %s's his name to %s.", sendername,giveplayer, tmp); ABroadCast(COLOR_YELLOW,string,1); } else { format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_RED, string); } } else { SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!"); } } else { SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!"); } return 1; } |