[Pedido] Sistema de ban com salvamento
#1

Bom alguйm poderia me passar um tutorial sistema de ban com salvamento utilizando o DOF2 por favor ?
Reply
#2

Esse aqui й um comando de ban que eu fiz esses tempos atras use ele como base, e para checar se o player esta banido use sua criatividade!.

OBS: Se for usar nгo esqueзa de criar a pasta Bans na scriptfiles
pawn Код:
CMD:ban(playerid, params[])
{
    new string[128], NomeP[MAX_PLAYER_NAME], Texto[128], NomeID[MAX_PLAYER_NAME], ID, pIP[26];
    if(PlayerInfo[playerid][Admin] < 2) return SendClientMessage(playerid,Vermelho,"[ERRO] Vocк nгo й admin!");
    if(PlayerInfo[ID][Admin] > 7) return SendClientMessage(playerid, COLOR_GOLD, "[Aviso] Nгo se deve banir fundadores.");
    if(sscanf(params,"us[128]",ID,Texto)) return SendClientMessage(playerid,Vermelho,"[USE]: /ban [id] [motivo]");
    if(!IsPlayerConnected(ID))return SendClientMessage(playerid,Vermelho,"[ERRO] Jogador Nгo Conectado!");
    GetPlayerName(playerid,NomeP,MAX_PLAYER_NAME);
    GetPlayerName(ID,NomeID,MAX_PLAYER_NAME);
    new str[64], year, month, day, hour, minute, second;
    getdate(year, month, day);
    gettime(hour, minute, second);
    GetPlayerIp(ID, pIP, sizeof pIP);
    format(string, sizeof(string), " -OperServer- O player %s foi banido pelo Administrador %s motivo: %s ",NomeID, NomeP, Texto);
    SendClientMessageToAll(Vermelho,string);
    format(string, sizeof(string), "%s", Texto);
    format(pIP, 64,"Bans/%s.ini",pIP);
    DOF2_CreateFile(pIP);
    DOF2_SetString(pIP, "Admin", NomeP);
    DOF2_SetString(pIP, "Nome", NomeID);
    DOF2_SetString(pIP, "IP", pIP);
    DOF2_SetString(pIP, "Motivo", string);
    format(str, sizeof(str), "%02d", day);
    DOF2_SetString(pIP, "Dia", str);
    format(str, sizeof(str), "%02d", month);
    DOF2_SetString(pIP, "Mes", str);
    format(str, sizeof(str), "%02d", year);
    DOF2_SetString(pIP, "Ano", str);
    format(str, sizeof(str), "%02d", hour);
    DOF2_SetString(pIP, "Horas", str);
    format(str, sizeof(str), "%02d", minute);
    DOF2_SetString(pIP, "Minutos", str);
    format(str, sizeof(str), "%02d", second);
    DOF2_SetString(pIP, "Segundos", str);
    DOF2_SaveFile();
    Kick(ID);
    return true;
}
Reply
#3

Olha Nгo й um tutorial mais Achei uma Include :

https://sampforum.blast.hk/showthread.php?tid=294087
Reply
#4

Estude alguns cуdigos que criei:

- Banir player temporariamente:
http://pastebin.com/EG1zQEz0

- Banir player permanente:
http://pastebin.com/E9b2rJMs
Reply
#5

Quote:
Originally Posted by matheus_alcapone
Посмотреть сообщение
Esse aqui й um comando de ban que eu fiz esses tempos atras use ele como base, e para checar se o player esta banido use sua criatividade!.

OBS: Se for usar nгo esqueзa de criar a pasta Bans na scriptfiles
pawn Код:
CMD:ban(playerid, params[])
{
    new string[128], NomeP[MAX_PLAYER_NAME], Texto[128], NomeID[MAX_PLAYER_NAME], ID, pIP[26];
    if(PlayerInfo[playerid][Admin] < 2) return SendClientMessage(playerid,Vermelho,"[ERRO] Vocк nгo й admin!");
    if(PlayerInfo[ID][Admin] > 7) return SendClientMessage(playerid, COLOR_GOLD, "[Aviso] Nгo se deve banir fundadores.");
    if(sscanf(params,"us[128]",ID,Texto)) return SendClientMessage(playerid,Vermelho,"[USE]: /ban [id] [motivo]");
    if(!IsPlayerConnected(ID))return SendClientMessage(playerid,Vermelho,"[ERRO] Jogador Nгo Conectado!");
    GetPlayerName(playerid,NomeP,MAX_PLAYER_NAME);
    GetPlayerName(ID,NomeID,MAX_PLAYER_NAME);
    new str[64], year, month, day, hour, minute, second;
    getdate(year, month, day);
    gettime(hour, minute, second);
    GetPlayerIp(ID, pIP, sizeof pIP);
    format(string, sizeof(string), " -OperServer- O player %s foi banido pelo Administrador %s motivo: %s ",NomeID, NomeP, Texto);
    SendClientMessageToAll(Vermelho,string);
    format(string, sizeof(string), "%s", Texto);
    format(pIP, 64,"Bans/%s.ini",pIP);
    DOF2_CreateFile(pIP);
    DOF2_SetString(pIP, "Admin", NomeP);
    DOF2_SetString(pIP, "Nome", NomeID);
    DOF2_SetString(pIP, "IP", pIP);
    DOF2_SetString(pIP, "Motivo", string);
    format(str, sizeof(str), "%02d", day);
    DOF2_SetString(pIP, "Dia", str);
    format(str, sizeof(str), "%02d", month);
    DOF2_SetString(pIP, "Mes", str);
    format(str, sizeof(str), "%02d", year);
    DOF2_SetString(pIP, "Ano", str);
    format(str, sizeof(str), "%02d", hour);
    DOF2_SetString(pIP, "Horas", str);
    format(str, sizeof(str), "%02d", minute);
    DOF2_SetString(pIP, "Minutos", str);
    format(str, sizeof(str), "%02d", second);
    DOF2_SetString(pIP, "Segundos", str);
    DOF2_SaveFile();
    Kick(ID);
    return true;
}
Cara o problema nгo nem criar o comando /ban mais sim o salvamento por isso que um tutorial pois etou interessado em aprender.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)