13.10.2016, 19:28
Hey, would this Anti Weapon Hack work for your opinion ?
And do you think there is a way to improve it ?
And do you think there is a way to improve it ?
PHP код:
// AntiCheat Callbacks
forward WeaponHack();
public WeaponHack()
{
new weaponid;
foreach(new playerid : Player)
{
weaponid = GetPlayerWeapon(playerid);
if(weaponid != PlayerInfo[playerid][pWeapon][GetWeaponSlot(weaponid)]) Kick(playerid);
}
}
PHP код:
stock GetWeaponSlot(weaponid)
{
new slot;
switch(weaponid)
{
case 0, 1: slot = 0; // No weapon
case 2 .. 9: slot = 1; // Melee
case 22 .. 24: slot = 2; // Handguns
case 25 .. 27: slot = 3; // Shotguns
case 28, 29, 32: slot = 4; // Sub-Machineguns
case 30, 31: slot = 5; // Machineguns
case 33, 34: slot = 6; // Rifles
case 35 .. 38: slot = 7; // Heavy Weapons
case 16, 18, 39: slot = 8; // Projectiles
case 42, 43: slot = 9; // Special 1
case 14: slot = 10; // Gifts
case 44 .. 46: slot = 11; // Special 2
case 40: slot = 12; // Detonators
default: slot = -1; // No slot
}
return slot;
}