[Pedido] Modo de banir um player;
#1

Boa Noite.
Estou com um comando de ban, porйm eu tava precisando que o nick que fosse banido ficasse salvo em um .ini
Exemplo;



E caso o nick do player estiver com " =1 ", e ele tentar logar ao servidor, tomar Kick...
Alguйm poderia me ajudar com esse problema?
Reply
#2

Up...
Reply
#3

Poste seu CMD

/BAN
Reply
#4

Fiz rбpidin aqui, bem simples, mas й oque vocк quer (Nгo testei, mas tenho certeza que vai funcionar).
pawn Код:
#include <a_samp>
#define FILTERSCRIPT
#include <sscanf>
#include <zcmd>
#include <DOF2>

new CheckBan[MAX_PLAYERS];

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" [FS] Ban");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    DOF2_Exit();
    return 1;
}

public OnPlayerConnect(playerid)
{
    CarregarCheckBan(playerid);
    if(CheckBan[playerid] == 1)
    {
        new bString[128], bName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, bName, MAX_PLAYER_NAME);
        format(bString, sizeof(bString), "Olб %s, desculpe, mas sua conta estб banida e vocк nгo poderб entrar neste sevidor!", bName);
        SendClientMessage(playerid, -1, bString);
        Kick(playerid);
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    SalvarCheckBan(playerid);
    return 1;
}

public OnPlayerUpdate(playerid)
{
    SalvarCheckBan(playerid);
    return 1;
}

CMD:banir(playerid, params[])
{
    new bID;
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Vocк nгo tem permissгo!");
    if(sscanf(params, "u", bID)) return SendClientMessage(playerid, -1, "USE: /banir [ID]");
    if(!IsPlayerConnected(bID)) return SendClientMessage(playerid, -1, "Player nгo conectado!");
    CheckBan[bID] = 1;
    return 1;
}

stock SalvarCheckBan(playerid)
{
    new arquivo[50], playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof(playername));
    format(arquivo, sizeof(arquivo), "Banidos/%s.ini", playername);
    if(DOF2_FileExists(arquivo))
    {
        DOF2_SetInt(arquivo, "Banido", CheckBan[playerid]);
    }
    else
    {
        DOF2_CreateFile(arquivo);
        DOF2_SetInt(arquivo, "Banido", CheckBan[playerid]);
    }
    return 1;
}

stock CarregarCheckBan(playerid)
{
    new arquivo[50], playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof(playername));
    format(arquivo, sizeof(arquivo), "Banidos/%s.ini", playername);
    CheckBan[playerid] = DOF2_GetInt(arquivo, "Admin");
    return 1;
}
Reply
#5

pawn Код:
#include "a_samp.inc"
#include "zcmd.inc"
#include "sscanf2.inc"


public OnPlayerConnect(playerid) {

    static file[30], name[24];
    format(file, 30, "%s.ban", (GetPlayerName(playerid, name, 24), name));
   
    if(fexist(file))
        return Kick(playerid);
       
    return 1;
}


cmd(ban, playerid, params[]) {

    static id;
    if(sscanf(params, #u, id))
        return 1;
       
    if(!IsPlayerConnected(id))
        return 1;
       
    static file[30], name[24];
    format(file, 30, "%s.ban", (GetPlayerName(playerid, name, 24), name));
    fclose(fopen(file, io_write));
       
    return Kick(id);
}
Reply
#6

[FilterScript] WSBan - Sistema de Banimento - https://sampforum.blast.hk/showthread.php?tid=308863
Reply
#7

Quote:
Originally Posted by WeenSoares_
Посмотреть сообщение
[FilterScript] WSBan - Sistema de Banimento - https://sampforum.blast.hk/showthread.php?tid=308863
Nem uso Y_ini :/
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)