Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define COLOR_BLUE 0x576E86FF
- #include <a_samp>
- #include <foreach>
- new
- bool: afk[MAX_PLAYERS],
- Float: last_hit[MAX_PLAYERS],
- inv_w[MAX_PLAYERS], // Warnings
- afkc[MAX_PLAYERS];
- forward CheckPaused();
- public OnFilterScriptInit()
- {
- print(" ---:: yInv by Yiin ");
- SetTimer("CheckPaused",5000,true);
- return 1;
- }
- public OnFilterScriptExit()
- return 1;
- public OnPlayerConnect(playerid)
- {
- afkc[playerid] = 0;
- afk[playerid] = false;
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- inv_w[playerid] = 0;
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- afkc[playerid] = 0;
- return 1;
- }
- public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
- {
- if(afk[damagedid]) return 0;
- new
- Float: hp,
- Float: arm,
- Float: HitPoints;
- GetPlayerHealth(damagedid, hp);
- GetPlayerArmour(damagedid, arm);
- HitPoints = hp + arm;
- if(last_hit[damagedid] < HitPoints)
- inv_w[damagedid]++;
- else
- inv_w[damagedid] = 0;
- if(inv_w[damagedid] > 12){
- SendClientMessage(damagedid, COLOR_BLUE, "INV detected");
- Kick(damagedid);
- }
- last_hit[damagedid] = HitPoints - amount;
- return 1;
- }
- public CheckPaused()
- {
- foreach(new i : Player)
- {
- if(afkc[i] > 2 && !afk[i])
- {
- afk[i] = true;
- }
- else if(afkc[i] < 3 && afk[i])
- {
- afk[i] = false;
- }
- afkc[i]++;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement