08.07.2014, 22:13
I challenged myself to make an anti c-bug system, and I came up with this script.
It detects these C-Bug method(s):
<> Aim, shoot, release aim + crouch [popular method]
<> While holding JUMP+SPRINT, you shoot and press C [never saw this before]
Doesn't detect this method (a slow one):
<> Crouch, aim, shoot, crouch, aim, shoot, repeat. [newbie cbuggers use this, this is not much a problem because it still shoots slow]
What weapon it detects?
>> Whatever you can CBug with, because I myself, tend to c-bug after using done shooting with any weapon I use.
Any false positives, yet?
>> By my experience, I haven't had any yet.
Not like other scripts, this one only have 66 lines.
I don't know if this is better than others, I am just trying another method I came up with.
Slaps you high in the air if you C-Bug as a punishment, you can change it to whatever you like.
http://www.youtube.com/watch?v=wuT2Q...ature=*********
If you find a bug/mistakes, please reply and tell me.
I will try my best to repair/fix it.
It detects these C-Bug method(s):
<> Aim, shoot, release aim + crouch [popular method]
<> While holding JUMP+SPRINT, you shoot and press C [never saw this before]
Doesn't detect this method (a slow one):
<> Crouch, aim, shoot, crouch, aim, shoot, repeat. [newbie cbuggers use this, this is not much a problem because it still shoots slow]
What weapon it detects?
>> Whatever you can CBug with, because I myself, tend to c-bug after using done shooting with any weapon I use.
Any false positives, yet?
>> By my experience, I haven't had any yet.
Not like other scripts, this one only have 66 lines.
I don't know if this is better than others, I am just trying another method I came up with.
pawn Code:
/*
anti crouch bug
by greentarch
*/
#include < a_samp >
new
gLastShot[ MAX_PLAYERS ];
#define HOLDING(%0) \
((newkeys & (%0)) == (%0))
public OnPlayerConnect( playerid )
return gLastShot[ playerid ] = -1;
public OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
{
if ( ( tickcount( ) - gLastShot[ playerid ] ) < 750 )
{
if ( HOLDING( KEY_JUMP | KEY_SPRINT | KEY_CROUCH ) )
{
new
Float: pPos[ 3 ];
GetPlayerPos( playerid, pPos[ 0 ], pPos[ 1 ], pPos[ 2 ] );
SetPlayerPos( playerid, pPos[ 0 ], pPos[ 1 ], pPos[ 2 ] + 10.0 );
GameTextForPlayer( playerid, "~r~Stop crouch bugging!", 1000, 3 );
gLastShot[ playerid ] = -1;
return 1;
}
if ( newkeys & KEY_CROUCH )
{
SetTimerEx( "__check", 200, false, "i", playerid );
}
}
return 1;
}
forward __check( playerid );
public __check( playerid )
{
if ( GetPlayerSpecialAction( playerid ) == SPECIAL_ACTION_DUCK )
return 1;
new
Float: pPos[ 3 ];
GetPlayerPos( playerid, pPos[ 0 ], pPos[ 1 ], pPos[ 2 ] );
SetPlayerPos( playerid, pPos[ 0 ], pPos[ 1 ], pPos[ 2 ] + 10.0 );
GameTextForPlayer( playerid, "~r~Stop crouch bugging!", 1000, 3 );
gLastShot[ playerid ] = -1;
return 1;
}
public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float: fX, Float: fY, Float: fZ )
{
gLastShot[ playerid ] = tickcount( );
return 1;
}
http://www.youtube.com/watch?v=wuT2Q...ature=*********
If you find a bug/mistakes, please reply and tell me.
I will try my best to repair/fix it.