Detecting rapidshot
#1

How can i detect rapid shots,i want to make my own anti cheat and i dont have any idea how to detect that the bullet was shot x seconds after the previous one.
Reply
#2

You can use the OnPlayerWeaponShot callback and use gettime(), store it somewhere to keep track of shooting intervals.

For instance:

lastShot[playerid] = gettime();

gettime() - lastShot[playerid] returns the amount of seconds that have passed from the moment the player fired a weapon.
Reply
#3

https://sampforum.blast.hk/showthread.php?tid=496637 has some accurate detection for all types of weapons.

@PaulDinam, it should also be noted that an MP5 and an AK-47 shoot a lot more bullets than normal weapons(I believe it's somewhere around 50(?) for MP5, and 70 for AK-47) per second.
Reply
#4

Quote:
Originally Posted by PaulDinam
Посмотреть сообщение
You can use the OnPlayerWeaponShot callback and use gettime(), store it somewhere to keep track of shooting intervals.

For instance:

lastShot[playerid] = gettime();

gettime() - lastShot[playerid] returns the amount of seconds that have passed from the moment the player fired a weapon.
Thanks
Reply


Forum Jump:


Users browsing this thread: