samp-weapon-config
samp-weapon-config copied to clipboard
Prevent hacked weapons
hook GivePlayerWeapon and reject damage if it's a hacked weapon. (inf ammo hacks with non-hacked weapons can be monitored with lagcomp on as well)
@Whitetigerswt Doesn't AddPlayerClass and SetSpawnInfo need hooked too then?
Weapons shouldn't be strictly monitored, though, as they could have been given by a filterscript or purchased in ammu-nation.
I'd say some simple checks to see if ammo doesn't drop when shooting would suffice for a default configuration. The rest should be (and can be) taken care by most anti-cheat scripts out there.
If someone wants to go through the task of adding full monitoring of weapons and ammo, I would gladly merge such a pull request, however.
If you hook the functions in the plugin, it'll work in filterscripts. and you can just re-create the menus for ammunation and hook SetPlayerShopName. - but really that begs the questions, how did you deal with pizza stack and burger shot menus if you're using server-sided health?
I suppose you'd have to hook AddPlayerClass and SetPlayerSpawnInfo as well Crayer, but really, the devil is in the details. it's certainly possible to have completely server-sided weapons and that was really my point. :P
p.s: random thought: can you detect if someone's in the ammunation menu by using GetPlayerCameraMode?
Just tested. It uses the fixed camera mode (15). So it would not be a very reliable way of testing, but could be extra security. The fixed camera mode is used when exiting and entering buildings and other things.