04.04.2017, 00:49
PHP код:
CMD:mudarnick(playerid, params[])
{
new nickn[20], nickold[24], pname[20], Ano1, Mes1, Dia1, Hora1, Minuto1, Segundo1, string[70], string2[80], string3[70];
if(sscanf(params, "s[20]", nickn)) return SendClientMessage(playerid, 0xFF0000FF, "| ERRO | Use: /MudarNick (novo nick).");
getdate(Ano1, Mes1, Dia1);
gettime(Hora1, Minuto1, Segundo1);
GetPlayerName(playerid, pname, 20);
GetPlayerName(playerid,nickold,24)
format(nickold, sizeof(nickold), "Contas/%s.ini", pname);
if(NickLiberado[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "| ERRO | Vocк nгo estб liberado para mudar nick. Peзa pelo /Duvida.");
if(NickLiberado[playerid] == 1)
{
format(string, sizeof(string), "Contas/%s.ini", nickold);
format(string3, sizeof(string3),"Contas/%s.ini", nickn);
format(string2,sizeof(string2), "| NICK | O(A) %s %s(%d) trocou de nick. Novo nick: %s (%02d/%02d/%02d %02d:%02d:%02d)", CargoAdm(playerid), pname, playerid, nickn, Dia1, Mes1, Ano1, Hora1, Minuto1, Segundo1);
SendClientMessageToAll(0xF3FF00AA, string2);
NickLiberado[playerid] = 0;
DOF2_RenameFile(string, string3);
SetPlayerName(playerid, nickn);
}
return 1;
}