daily pastebin goal
52%
SHARE
TWEET

Anti BunnyHop System By peppinux aka Peppe_Stasu

a guest Aug 18th, 2010 448 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top