pawn Код:
COMMAND:ban(playerid, params[])
{
new PlayerToBan, Days, Hours, Reason[128], TotalBanTime, Msg[128], Name[24], AdminName[24];
SendAdminText(playerid, "/ban", params);
if (APlayerData[playerid][LoggedIn] == true)
{
if (APlayerData[playerid][PlayerLevel] >= 3)
{
if (sscanf(params, "uiis[128]", PlayerToBan, Days, Hours, Reason))
SendClientMessage(playerid, 0xFF0000AA, "Digite: \"/ban <Player> <Dias> <Horas> <Motivo>\"");
else
{
if (IsPlayerConnected(PlayerToBan))
{
GetPlayerName(playerid, AdminName, sizeof(AdminName));
GetPlayerName(PlayerToBan, Name, sizeof(Name));
APlayerData[PlayerToBan][Bans]++;
TotalBanTime = (Days * 86400) + (Hours * 3600) + gettime();
if (APlayerData[PlayerToBan][Bans] == 5)
APlayerData[PlayerToBan][BanTime] = 2147483640; // Make the ban permanent (as high as it can go)
else
APlayerData[PlayerToBan][BanTime] = TotalBanTime; // Store this value for the player
if (APlayerData[PlayerToBan][Bans] == 5)
{
format(Msg, 128, "Voce foi Banido Permanente por %s, essa e a sua Ban numero 5", AdminName);
SendClientMessage(PlayerToBan, 0x808080FF, Msg);
}
else
{
format(Msg, 128, "Voce Foi Banido Por %s por %i dias e %i horas", AdminName, Days, Hours);
SendClientMessage(PlayerToBan, 0x808080FF, Msg);
format(Msg, 128, "Motivo: %s", Reason);
SendClientMessage(PlayerToBan, 0x808080FF, Msg);
format(Msg, 128, "Voce Foi Banido %i Vezes, a 5t e Permanente", APlayerData[PlayerToBan][Bans]);
SendClientMessage(PlayerToBan, 0x808080FF, Msg);
}
// Kick the player (his data will be saved)
Kick(PlayerToBan);
// Inform everybody else which player was banned and for how long
format(Msg, 128, "-|%s %s Baniu %s por %i dias e %i horas|-", AdminLevelName[APlayerData[playerid][PlayerLevel]], AdminName, Name, Days, Hours);
SendClientMessageToAll(0xFF0000AA, Msg);
}
}
}
else
return 0;
}
else
return 0;
return 1;
}
se voce usar Dialog em vez de set timer tambem funciona, pelo menos comigo no meu gm funciona, tenta ae