Quote:
Originally Posted by Kiyozi_Mu
pawn Код:
CMD:changename(playerid, params[]) { new id, newname[MAX_PLAYER_NAME]; if(sscanf(params, "us[24]", id, newname)) return SendClientMessage(playerid, -1, "USAGE: /changename [playerid] [new name]");
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not admin!"); //Change it to your admin enum or whatever if(IsPlayerConnected(id)) { new pname[MAX_PLAYER_NAME]; GetPlayerName(id, pname, MAX_PLAYER_NAME); if(strcmp(pname, newname)) { SetPlayerName(id, newname);
new string[64]; format(string, sizeof(string), "users/%s.ini", pname); // Your user data folder fremove(string); //Then re-save the player } else return SendClientMessage(playerid, -1, "Oldname & Newname cannot same!"); } else return SendClientMessage(playerid, -1, "Player not connected!"); return 1; }
|
Why the changename isn't saving ??when i logout , and login back with the new name why i must register ?? I'm Checking in the Scriptfiles/User/%s.sav the name isn't change to the new name.