SA-MP Forums Archive
Allow c-bug [REP++] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Allow c-bug [REP++] (/showthread.php?tid=562538)



Allow c-bug [REP++] - nezo2001 - 09.02.2015

now.....When i use c-bug the server banned me for ammo hack how to check if the player pressed key fire and didn't press c key ?
my code to check for the key
PHP код:
#define PRESSED(%0) \
    
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) 
PHP код:
if (PRESSED(KEY_FIRE)) 



Re: Allow c-bug [REP++] - nezo2001 - 09.02.2015

In another way i want to check if the player pressed FireKey and didn't press C key


Re: Allow c-bug [REP++] - CalvinC - 09.02.2015

pawn Код:
if((newkeys & KEY_FIRE) && !(newkeys & KEY_CROUCH))
This will check if a player presses the fire key, while he doesn't press the crouch key.
Although if you want to check for c-bugging, this probably won't be the most effective way to check for it, as it only checks if you press both keys at the same time.

It might work some of the time, but it would be better to check if the player presses the crouch key after pressing the fire key, maybe with a small timer of half a second or so.


Re: Allow c-bug [REP++] - nezo2001 - 09.02.2015

Ok i will try