Advertisement
Guest User

Untitled

a guest
Mar 8th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.87 KB | None | 0 0
  1. new string[128];
  2. format(string, sizeof(string), "Admin %s[%i] just has banned player %s[%i]. [Reason: %s]", PlayerName(playerid), playerid, PlayerName(id), id, param2);
  3. SendClientMessageToAll(0xFF0000FF, string); // I will send a message to all at first
  4.  
  5. // "Flag" the player to be banned with a unix timestamp.
  6. Player[playerid][Ban] = gettime() + 3000; // That will set the variable to be 3 seconds from now.
  7. format(Player[playerid][BanReason], sizeof(Player[playerid][BanReason]), "%s", param2); // Also stor ethe ban reason.
  8.  
  9. public OnPlayerUpdate(playerid)
  10. {
  11.     if(Player[playerid][Ban] != 0) // Adding this check first so it doesn't have to execute gettime() every check.
  12.     {
  13.         if(Player[playerid][Ban] < gettime()) // if its less than the current time then 3 seconds have passed.
  14.         {
  15.             BanEx(playerid, Player[playerid][BanReason]); // I will ban the player  
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement