[Ajuda] Info ban
#2

Faz criando uma pasta tipo:

PHP код:
public OnGameModeInit()
{
    if(!
DOF2_FileExists("Banidos/Nick.ini"))
    {
        
DOF2_CreateFile("Banidos/Nick.ini");
    }

Connect

PHP код:
public OnPlayerConnect(playerid)
{
    new 
aNome[MAX_PLAYER_NAME];
    
GetPlayerName(playeridaNomeMAX_PLAYER_NAME);
    if(
DOF2_GetInt("Banidos/Nick.ini"aNome) == 1)
    {
        new 
ip[16];
        
GetPlayerIp(playeridip16);
        
        
format(gStrsizeof(gStr), "Vocк estб banido(a)!\n\nNick: %s\nResponsбvel: Nнnguem\nMotivo: Nada\nIP: %s"aNomeip);
        
ShowPlayerDialog(playerid9999DIALOG_STYLE_MSGBOX"{FF0000}Banido"gStr"Ok""");
        
SetTimerEx("KickPlayer"200false"d"playerid);    
    }
    return 
1;

Comando:

PHP код:
    CMD:Ban(playeridparams[])
    {
        new 
IDMotivo[32], Msgban[128];
        new 
aName[MAX_PLAYER_NAME]; 
        
GetPlayerName(playeridaNameMAX_PLAYER_NAME);               
        if(
Player[playerid][Fundador] <= 0) return SendClientMessage(playeridCOLOR_ERRO"[ x ] Vocк nгo tem permissгo!");
        if(
sscanf(params"us[50]"IDMotivo)) return SendClientMessage(playeridCOLOR_ERRO"[ x ] Uso correto: /Ban [ ID ] [ Motivo ]");
        if(!
IsPlayerConnected(ID)) return SendClientMessage(playeridCOLOR_ERRO"[ x ] Jogador(a) nгo conectado(a)!");
        new 
pName[MAX_PLAYER_NAME];
        
GetPlayerName(IDpNameMAX_PLAYER_NAME);
        
        
SetTimerEx("KickPlayer"200false"d"ID);
        
DOF2_SetInt("Banidos/Nick.ini"pName1);
        
format(Msgbansizeof(Msgban), "| INFO | O(A) Moderador(a) %s baniu o jogador(a) %s ( Motivo: %s )"aNamepNameMotivo);
        
SendClientMessageToAll(COLOR_AZULMsgban);
        return 
1;
    }
    
//Public Kick
    
forward KickPlayer(playerid);
    public 
KickPlayer(playerid)
    {
        
Kick(playerid);
        return 
1;
    } 
Ai sim vai verificar se o player esta banido(a) ou n! Se nгo de certo assim, o certo e salvar se o player ta banido ou nao! :\

* Obs: no /Ban nгo precisa de colocar Ban(ID);
Reply


Messages In This Thread
Info ban - by Hunterx157 - 25.05.2018, 22:12
Re: Info ban - by AutoMatic2 - 25.05.2018, 22:45

Forum Jump:


Users browsing this thread: 1 Guest(s)