23.09.2017, 19:55
I believe it's something to do with GetPlayerAmmo as it returns the old ammo so you need to subtract 1 from GetPlayerAmmo to get the new ammo. Also you should create a variable for the ammo and weapon slot instead of repeating the functions and these weaponid checks are not necessary because OnPlayerWeaponShot is only called when you shoot a gun, but I suggest you to check if the weaponid is not the minigun because it's fire rate is so fast that it will kick you whenever you shoot it and I also suggest you to create a variable for warnings. Everytime player shoots and has cheated ammo add 1 to the warnings variable and when it reaches 3 kick the player for example, but when player hasn't cheated ammo then subtract 1 from the warnings variable if there's something to subtract. That's what I do because this will prevent false kicks most of the time.