samp-weapon-config icon indicating copy to clipboard operation
samp-weapon-config copied to clipboard

Prevent hacked weapons

Open Whitetigerswt opened this issue 10 years ago • 4 comments

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 avatar Feb 21 '15 20:02 Whitetigerswt

@Whitetigerswt Doesn't AddPlayerClass and SetSpawnInfo need hooked too then?

Crayder avatar Feb 21 '15 23:02 Crayder

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.

oscar-broman avatar Feb 21 '15 23:02 oscar-broman

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?

Whitetigerswt avatar Feb 21 '15 23:02 Whitetigerswt

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.

Crayder avatar Feb 22 '15 03:02 Crayder