Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new string[128];
- format(string, sizeof(string), "Admin %s[%i] just has banned player %s[%i]. [Reason: %s]", PlayerName(playerid), playerid, PlayerName(id), id, param2);
- SendClientMessageToAll(0xFF0000FF, string); // I will send a message to all at first
- // "Flag" the player to be banned with a unix timestamp.
- Player[playerid][Ban] = gettime() + 3000; // That will set the variable to be 3 seconds from now.
- format(Player[playerid][BanReason], sizeof(Player[playerid][BanReason]), "%s", param2); // Also stor ethe ban reason.
- public OnPlayerUpdate(playerid)
- {
- if(Player[playerid][Ban] != 0) // Adding this check first so it doesn't have to execute gettime() every check.
- {
- if(Player[playerid][Ban] < gettime()) // if its less than the current time then 3 seconds have passed.
- {
- BanEx(playerid, Player[playerid][BanReason]); // I will ban the player
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement