[Ajuda] Sistema de Ban (Com Salvamento)
#1

Bem Galera eu e meu amigo tamos criando um GM do zero , e eu como sou script iniciante queria saber como criar um sistema de ban, Tipoh /ban e /desban ect.
Quem puder me ajudar fico muito grato!
Reply
#2

Код:
CMD:ban(playerid, params[])
{
    new string[128], NomeP[MAX_PLAYER_NAME], Texto[128], NomeID[MAX_PLAYER_NAME], ID, pIP[26], arquivo[64];
    if(PlayerInfo[playerid][Admin] < 2)return SendClientMessage(playerid, COLOR_RED, "[ERRO] Vocк nгo tem permissгo para usar esse comando.");
    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(arquivo, 64,"Bans/%s.ini",NomeID);
 	DOF2_CreateFile(arquivo);
 	DOF2_SetString(arquivo, "Admin", NomeP);
 	DOF2_SetString(arquivo, "Nome", NomeID);
 	DOF2_SetString(arquivo, "IP", pIP);
 	DOF2_SetString(arquivo, "Motivo", string);
 	format(str, sizeof(str), "%02d", day);
	DOF2_SetString(arquivo, "Dia", str);
	format(str, sizeof(str), "%02d", month);
	DOF2_SetString(arquivo, "Mes", str);
	format(str, sizeof(str), "%02d", year);
	DOF2_SetString(arquivo, "Ano", str);
	format(str, sizeof(str), "%02d", hour);
	DOF2_SetString(arquivo, "Horas", str);
	format(str, sizeof(str), "%02d", minute);
	DOF2_SetString(arquivo, "Minutos", str);
	format(str, sizeof(str), "%02d", second);
	DOF2_SetString(arquivo, "Segundos", str);
 	DOF2_SaveFile();
    Kick(ID);
    return true;
}
Use a logica para checar se o player esta banido ou nгo.
Reply
#3

Okay, Obrigado cara
Reply
#4

uso e recomendo!
https://sampforum.blast.hk/showthread.php?tid=294087
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)