Posts: 3,133
Threads: 71
Joined: Dec 2013
Reputation:
0
Ammo can be given with GivePlayerWeapon. For instance,
GivePlayerWeapon(playerid, 26, 99);
That would give the player a sawn-off shotgun with 99 ammo.
Posts: 1,164
Threads: 20
Joined: Oct 2008
Reputation:
0
There's no reliable way to script an anti ammo hack.
Even with the latest callback of OnPlayerWeaponShot, there are still problems with the timing of the data (i've tried doing this with a 5s timer check, yet the data was always off by a second, and i've tried to add a +-5 ammo tolerance and it still failed), plus, it wont work with all ammo based weapons.
The closest you can do is to store the Max ammo value you give to the player, then check if the player exceeds that value. However it is not the best method since most of ammo hacks freeze the ammo instead of increasing it.