Advertisement
Guest User

Anti BunnyHop System By peppinux aka Peppe_Stasu

a guest
Aug 18th, 2010
553
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.15 KB | None | 0 0
  1. //In cima
  2. #define COLOR_RED 0xFF0000AA
  3.  
  4. #define LIMITE_SALTI 5//Cambiatelo col numero massimo di salti che un player deve fare per far spuntare l'avviso agli admins
  5.  
  6. new BunnyHop[MAX_PLAYERS];
  7.  
  8. //Sotto OnPlayerConnect
  9. BunnyHop[playerid] = 0;
  10.  
  11. //Sotto OnPlayerKeyStateChange
  12.     if(newkeys & KEY_JUMP && !IsPlayerInAnyVehicle(playerid))
  13.     {
  14.         BunnyHop[playerid]++;
  15.         if(BunnyHop[playerid] == LIMITI_SALTI)
  16.         {
  17.             new string[128];
  18.             format(string,sizeof(string),"[ATTENZIONE]Si sospetta che %s stia facendo BunnyHop. Controlla!",PlayerName(playerid));
  19.             MessaggioAdmin(COLOR_RED,string);
  20.             SetTimerEx("ResetBunnyHop",10*1000,false,"i",playerid);
  21.         }
  22.     }
  23.  
  24. //Fuori da tutto
  25. PlayerName(playerid)
  26. {
  27.     new playerName[MAX_PLAYER_NAME];
  28.     GetPlayerName(playerid,playerName,sizeof(playerName));
  29.     return playerName;
  30. }
  31.  
  32. MessaggioAdmin(colore,string[])
  33. {
  34.     for(new i = 0; i < GetMaxPlayers(); i++)
  35.     {
  36.         if(IsPlayerConnected(i) && IsPlayerAdmin(i))
  37.         {
  38.             SendClientMessage(i,colore,string);
  39.             printf(string);
  40.         }
  41.     }
  42. }
  43.  
  44. forward ResetBunnyHop(playerid);
  45. public ResetBunnyHop(playerid)
  46. {
  47.     BunnyHop[playerid] = 0;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement