Advertisement
Guest User

Anti Rapid Fire 0.3z

a guest
Feb 21st, 2014
3,598
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.70 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new shotTime[MAX_PLAYERS];
  4. new shot[MAX_PLAYERS];
  5.  
  6. public OnFilterScriptInit()
  7. {
  8.     print("\n--------------------------------------");
  9.     print(" Anti Rapid Fire");
  10.     print("--------------------------------------\n");
  11.     return 1;
  12. }
  13.  
  14. public OnPlayerConnect(playerid)
  15. {
  16.     shotTime[playerid] = 0;
  17.     shot[playerid] = 0;
  18.     return 1;
  19. }
  20.  
  21. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  22. {
  23.     if(weaponid != 38)
  24.     {
  25.         if((gettime() - shotTime[playerid]) < 1)
  26.         {
  27.             shot[playerid]+=1;
  28.         }
  29.         else
  30.         {
  31.             shot[playerid]=0;
  32.         }
  33.         if(shot[playerid] > 10)
  34.         {
  35.             Kick(playerid);
  36.         }
  37.         shotTime[playerid] = gettime();
  38.     }
  39.     return 1;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement