01.05.2013, 19:40
Print:
*/ O Player Nгo Precisarб relogar e mudar o nick no sa-mp na hora que mudou o nick so na hora de relogar /*
Feito Por: Dan
*/ O Player Nгo Precisarб relogar e mudar o nick no sa-mp na hora que mudou o nick so na hora de relogar /*
PHP код:
#include <a_samp>
#include <sscanf>
#include <zcmd>
#include <dof2>
// - Defines - //
#define CONTAS "PastaDasContas/%s.ini"
// - Public's - //
public OnFilterScriptInit() return 1;
public OnFilterScriptExit() return 1;
// - Comandos - //
CMD:mudarnick(playerid, params[])
{
new id, NovoNick[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME], String[25], StrMDN[125], pNameA[MAX_PLAYER_NAME];
if(sscanf(params, "us", id, NovoNick)) return SendClientMessage(playerid, -1, "Uso Correto: /mudarnick [id do player] [novo nick]");
if(IsPlayerAdmin(playerid))
{
GetPlayerName(id, pName, sizeof(pName));
GetPlayerName(playerid, pNameA, sizeof(pNameA));
format(String, sizeof(String), CONTAS, pName);
DOF2_RenameFile(String, NovoNick);
DOF2::SaveFile();
SetPlayerName(id, NovoNick);
format(StrMDN, sizeof(StrMDN), "*~~D_Info~~* O Administrador %s mudou o nick do player %s para %s.", pNameA, pName, NovoNick);
SendClientMessageToAll(-1, StrMDN);
}
else
{
SendClientMessage(playerid, -1, "ERRO: Vocк nгo й um Administrador Logado na RCON!");
return 1;
}
return true;
}