[Ajuda] Sistema de Ban (Com Salvamento)
#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


Messages In This Thread
Sistema de Ban (Com Salvamento) - by Mathews_Martinez - 15.10.2012, 15:56
Re: Sistema de Ban (Com Salvamento) - by MatheusAlcapone - 15.10.2012, 16:07
Re: Sistema de Ban (Com Salvamento) - by Mathews_Martinez - 16.10.2012, 10:17
Re: Sistema de Ban (Com Salvamento) - by Sky™ - 16.10.2012, 15:45

Forum Jump:


Users browsing this thread: 1 Guest(s)