Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // By Snoowker
- #include a_samp
- #define MAX_AIM_TICKS 3
- public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
- {
- if(damagedid == INVALID_PLAYER_ID || !CheckFireArm(GetPlayerWeapon(playerid)) || GetPlayerTargetPlayer(playerid) != INVALID_PLAYER_ID) return 1;
- new count = GetPVarInt(playerid, "aimcount"), ticks = GetPVarInt(playerid, "aimtick"), currtick = GetTickCount();
- if(currtick - ticks <= 10000 && count + 1 >= MAX_AIM_TICKS)
- {
- new msg[144], name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, MAX_PLAYER_NAME);
- format(msg, 144, "%s[%i] кикнут по подозрению на использование Aim / Joypad.", name, playerid);
- SendClientMessageToAll(-1, msg);
- Kick(playerid);
- }
- else if(currtick - ticks > 10000)
- {
- DeletePVar(playerid, "aimcount");
- DeletePVar(playerid, "aimtick");
- count = 0;
- currtick = GetTickCount();
- }
- SetPVarInt(playerid, "aimcount", count + 1);
- SetPVarInt(playerid, "aimtick", currtick);
- return 1;
- }
- CheckFireArm(weaponid)
- {
- switch(weaponid)
- {
- case 16..39, 41..43: return 1;
- default: return 0;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement