[FilterScript] Sistema de Mudança de Nick (For Admin's RCON)

6 de jul. de 2013.
Não é necessário o administrador reconectar no servidor.

Imagem:


Download:

PHP Code:
#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(playeridparams[])
{
    new 
idNovoNick[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME], String[25], StrMDN[125], pNameA[MAX_PLAYER_NAME];
    if(
sscanf(params"us"idNovoNick)) return SendClientMessage(playerid, -1"Uso Correto: /mudarnick [id do player] [novo nick]");
    if(
IsPlayerAdmin(playerid))
    {
        
GetPlayerName(idpNamesizeof(pName));
        
GetPlayerName(playeridpNameAsizeof(pNameA));
        
format(Stringsizeof(String), CONTASpName);
        
DOF2_RenameFile(StringNovoNick);
        
DOF2::SaveFile();
        
SetPlayerName(idNovoNick);
        
format(StrMDNsizeof(StrMDN), "*~~D_Info~~* O Administrador %s mudou o nick do player %s para %s."pNameApNameNovoNick);
        
SendClientMessageToAll(-1StrMDN);
    }
    else
    {
        
SendClientMessage(playerid, -1"ERRO: Você não é um Administrador Logado na RCON!");
        return 
1;
    }
    return 
true;
}  
Creditos: 
Feito por: Dan

0 comentários:

Postar um comentário