Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
- {
- switch(weaponid){ case 0..18, 39..54: return 1;}//invalid weapons
- if(hittype == BULLET_HIT_TYPE_PLAYER && IsPlayerConnected(hitid) && !IsPlayerNPC(hitid))
- {
- new Float:Shot[3], Float:Hit[3];
- GetPlayerLastShotVectors(playerid, Shot[0], Shot[1], Shot[2], Hit[0], Hit[1], Hit[2]);
- new playersurf = GetPlayerSurfingVehicleID(playerid);
- new hitsurf = GetPlayerSurfingVehicleID(hitid);
- new Float:targetpackets = NetStats_PacketLossPercent(hitid);
- new Float:playerpackets = NetStats_PacketLossPercent(playerid);
- if(~(playersurf) && ~(hitsurf) && !IsPlayerInAnyVehicle(playerid) && !IsPlayerInAnyVehicle(hitid))
- {
- if(!IsPlayerAimingAtPlayer(playerid, hitid) && !IsPlayerInRangeOfPoint(hitid, 5.0, Hit[0], Hit[1], Hit[2]))
- {
- new string[128], issuer[24];
- GetPlayerName(playerid, issuer, 24);
- AimbotWarnings[playerid] ++;
- format(string, sizeof(string), "{FFFFFF}Player %s warning of aimbot or lag [Target PL: %f | Shooter PL:%f]!", issuer, targetpackets, playerpackets);
- for(new p; p < MAX_PLAYERS;p++)
- if(IsPlayerConnected(p) && IsPlayerAdmin(p))
- SendClientMessage(p, -1, string);
- if(AimbotWarnings[playerid] > 10)
- {
- if(targetpackets < 1.2 && playerpackets < 1.2)
- {
- format(string, 128, "Player %s has been kicked for aimbot!", issuer);
- SendClientMessageToAll(0xFF0000, string);
- SetTimerEx("DelayKick", 1500, false, "i", playerid);
- }
- else
- {
- format(string, sizeof(string), "{FFFFFF}Player %s is probably using aimbot [Target PL: %f | Shooter PL:%f]!", issuer, targetpackets, playerpackets);
- for(new p; p < MAX_PLAYERS;p++) if(IsPlayerConnected(p) && IsPlayerAdmin(p)) SendClientMessage(p, -1, string);
- }
- }
- return 0;
- }
- else return 1;
- }
- else return 1;
- }
- return 1;
- }
- forward DelayKick(playerid);
- public DelayKick(playerid) return Kick(playerid);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement