Advertisement
Guest User

Untitled

a guest
Jul 1st, 2012
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.24 KB | None | 0 0
  1. // By Snoowker
  2. #include a_samp
  3.  
  4. #define MAX_AIM_TICKS 3
  5.  
  6. public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
  7. {
  8.     if(damagedid == INVALID_PLAYER_ID || !CheckFireArm(GetPlayerWeapon(playerid)) || GetPlayerTargetPlayer(playerid) != INVALID_PLAYER_ID) return 1;
  9.     new count = GetPVarInt(playerid, "aimcount"), ticks = GetPVarInt(playerid, "aimtick"), currtick = GetTickCount();
  10.     if(currtick - ticks <= 10000 && count + 1 >= MAX_AIM_TICKS)
  11.     {
  12.         new msg[144], name[MAX_PLAYER_NAME];  
  13.         GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  14.         format(msg, 144, "%s[%i] кикнут по подозрению на использование Aim / Joypad.", name, playerid);
  15.         SendClientMessageToAll(-1, msg);
  16.         Kick(playerid);
  17.     }
  18.     else if(currtick - ticks > 10000)
  19.     {
  20.         DeletePVar(playerid, "aimcount");
  21.         DeletePVar(playerid, "aimtick");
  22.         count = 0;
  23.         currtick = GetTickCount();
  24.     }
  25.     SetPVarInt(playerid, "aimcount", count + 1);
  26.     SetPVarInt(playerid, "aimtick", currtick);
  27.     return 1;
  28. }
  29.  
  30. CheckFireArm(weaponid)
  31. {
  32.     switch(weaponid)
  33.     {
  34.         case 16..39, 41..43: return 1;
  35.         default: return 0;
  36.     }
  37.     return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement