Anti Bike Bunny Hop (Accurate) - Patrick - 30.09.2013
Introduction
Since loads of people requesting and posting about this, especially newbies, this might able to help them, this script is useful for Roleplay servers and I'm sure that this is accurate since I tested this loads of time before I released it
Anti Bike Bunny Hop | Code
pawn Code:
//----------------------------------[Credits]-----------------------------------// pds2012 - creating this filterscript - Forum Account: http://forum.sa-mp.com/member.php?u=178953// park4bmx - gave me usefull snippets - Forum Account: http://forum.sa-mp.com/member.php?u=74783// Kalcor/Kyle - for the #include <a_samp>//------------------------------------------------------------------------------//----------------------------------[Include]-----------------------------------#include < a_samp >//------------------------------------------------------------------------------//----------------------------------[Defines]-----------------------------------#define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))#define RELEASED(%0) (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))#define SlapPlayer //If you want to slap the player out of the vehicle or using RemovePlayerFromVehicle function to remove the player//------------------------------------------------------------------------------public OnFilterScriptInit
() return true;
public OnFilterScriptExit
() return true;
new HoldingButton
[ MAX_PLAYERS
][ 2 ] = 0,
PlayerButtonTimer
[ MAX_PLAYERS
];
public OnPlayerKeyStateChange
(playerid, newkeys, oldkeys
){ if( !IsPlayerConnected
( playerid
)) return true;
new VehicleID
= GetPlayerVehicleID
(playerid
);
if( GetVehicleModel
( VehicleID
) == 509 || GetVehicleModel
( VehicleID
) == 481 || GetVehicleModel
( VehicleID
) == 510 ) { if( PRESSED
( KEY_ACTION
)) { HoldingButton
[ playerid
][ 0 ] = 1;
HoldingButton
[ playerid
] [ 1 ] = KEY_ACTION;
PlayerButtonTimer
[ playerid
] = SetTimerEx
("HoldingUpdate",
2500, false,
"i", playerid
);
SendClientMessage
(playerid,
-1,
"[DEBUG]: Timer HoldingUpdate time is running, and HoldingButton Variable has been set to 1 & Key Action");
//SendClientMessage is for debug purposes, remove this when you've done testing it } else if( RELEASED
( KEY_ACTION
)) { HoldingButton
[ playerid
][ 0 ] = 0;
KillTimer
( PlayerButtonTimer
[ playerid
] );
SendClientMessage
(playerid,
-1,
"[DEBUG]: Timer Killed and Variable HoldingButton has been set to 0");
//SendClientMessage is for debug purposes, remove this when you've done testing it } } return true;
}forward HoldingUpdate
(playerid
);
public HoldingUpdate
(playerid
){ #if defined SlapPlayer new Float:PosX,
Float:PosY,
Float:PosZ;
GetPlayerPos
(playerid, PosX, PosY, PosZ
);
SetPlayerPos
(playerid, PosX, PosY, PosZ
+2);
#else RemovePlayerFromVehicle
(playerid
);
#endif HoldingButton
[ playerid
][ 0 ] = 0;
SendClientMessage
(playerid,
-1,
"[DEBUG]: Variable HoldingButton has been set to 0");
//SendClientMessage is for debug purposes, remove this when you've done testing it return true;
}
Video
http://www.youtube.com/watch?v=9U1lg...ature=*********
Bugs:
None, if you found a bug feel free to comment below and I'll fix it as soon as possible
Best Regards,
pds2012
Any Positive/Negative comments will be appreciated
Re: Anti Bike Bunny Hop (Accurate) -
BodyBoardVEVO - 30.09.2013
Great !
Re: Anti Bike Bunny Hop (Accurate) -
Team_PRO - 30.09.2013
Well Good
Re: Anti Bike Bunny Hop (Accurate) - Patrick - 30.09.2013
Quote:
Originally Posted by BodyBoardVEVO
Great !
|
Quote:
Originally Posted by Team_PRO
Well Good
|
Appreciate your comments guys
Re: Anti Bike Bunny Hop (Accurate) -
PT - 30.09.2013
very good!
Re: Anti Bike Bunny Hop (Accurate) -
Jefff - 01.10.2013
The best part is
if( IsPlayerConnected( playerid ) ) return 1;
pawn Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
// Player is connected script dont work
if( IsPlayerConnected( playerid )) return 1;
new VehicleID = GetPlayerVehicleID(playerid);
// We dont need IsPlayerInAnyVehicle, you can use if(VehicleID) and why 3 times GetVehicleModel ? new Model = GetVehicleModel( VehicleID ); then replace all GetVehicleModel( VehicleID ) to Model
if( IsPlayerInAnyVehicle(playerid) && GetVehicleModel( VehicleID ) == 509 || GetVehicleModel( VehicleID ) == 481 || GetVehicleModel( VehicleID ) == 510 )
{
if( PRESSED( KEY_ACTION ))
{
// HoldingButton ? wth is that and for what ? you dont use this in FS
HoldingButton[ playerid ][ 0 ] = 1;
HoldingButton[ playerid] [ 1 ] = KEY_ACTION;
// SetTimerEx ? ehm
PlayerButtonTimer[ playerid ] = SetTimerEx("HoldingUpdate", 2500, false, "i", playerid);
SendClientMessage(playerid, -1, "[DEBUG]: Timer HoldingUpdate time is running, and HoldingButton Variable has been set to 1 & Key Action");
//SendClientMessage is for debug purposes, remove this when you've done testing it
}
else if( RELEASED( KEY_ACTION ))
{
// HoldingButton ? wth is that and for what ? you dont use this in FS
HoldingButton[ playerid ][ 0 ] = 0;
KillTimer( PlayerButtonTimer[ playerid ] );
SendClientMessage(playerid, -1, "[DEBUG]: Timer Killed and Variable HoldingButton has been set to 0");
//SendClientMessage is for debug purposes, remove this when you've done testing it
}
}
return 1;
}
Simply and very basic version:
pawn Code:
#include <a_samp>
#define SlapPlayer //If you want to slap the player out of the vehicle or using RemovePlayerFromVehicle function to remove the player
PunishPlayer(playerid)
{
#if defined SlapPlayer
new Float:PosX, Float:PosY, Float:PosZ;
GetPlayerPos(playerid, PosX, PosY, PosZ);
SetPlayerPos(playerid, PosX, PosY, PosZ+0.5);
#else
RemovePlayerFromVehicle(playerid);
#endif
return 0;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new VehicleID = GetPlayerVehicleID(playerid);
if(0 < VehicleID < MAX_VEHICLES) // or if(VehicleID)
{
new VehicleModel = GetVehicleModel( VehicleID );
if( VehicleModel == 481 || VehicleModel == 509 || VehicleModel == 510 )
if(oldkeys & KEY_ACTION)
return PunishPlayer(playerid);
}
return 1;
}
Re: Anti Bike Bunny Hop (Accurate) -
Team_PRO - 01.10.2013
make anti cheat for better, just suggesting, up to you if you gonna make
Re: Anti Bike Bunny Hop (Accurate) - Patrick - 01.10.2013
Quote:
Originally Posted by Jefff
The best part is
if( IsPlayerConnected( playerid ) ) return 1;
|
Just made a mistake right there
, forgot to put an !(Exclamation Mark), Code Updated
Re: Anti Bike Bunny Hop (Accurate) -
xganyx - 01.10.2013
Good Work, mate!
Re: Anti Bike Bunny Hop (Accurate) -
n0minal - 01.10.2013
Nice job, well done!
Re: Anti Bike Bunny Hop (Accurate) - Patrick - 04.10.2013
Quote:
Originally Posted by xganyx
Good Work, mate!
|
Quote:
Originally Posted by n0minal
Nice job, well done!
|
Cheers!
Re: Anti Bike Bunny Hop (Accurate) -
mini_mi - 05.10.2013
not bad
Re: Anti Bike Bunny Hop (Accurate) - Patrick - 05.10.2013
Quote:
Originally Posted by mini_mi
not bad
|
Thanks.
Re: Anti Bike Bunny Hop (Accurate) -
Rube - 08.10.2013
goooooooooooooooooooooooooooooooooooooooood
niga
Re: Anti Bike Bunny Hop (Accurate) - Patrick - 14.10.2013
Quote:
Originally Posted by Rube
goooooooooooooooooooooooooooooooooooooooood
niga
|
Cheers,
LoL'ed at your comment.
Re: Anti Bike Bunny Hop (Accurate) -
DanishHaq - 14.10.2013
Nice job, seems interesting and quite cool for RP servers.
Re: Anti Bike Bunny Hop (Accurate) - Patrick - 14.10.2013
Quote:
Originally Posted by DanishHaq
Nice job, seems interesting and quite cool for RP servers.
|
Thanks.
Re: Anti Bike Bunny Hop (Accurate) -
DowDaw - 22.11.2013
Good job mate.
Re: Anti Bike Bunny Hop (Accurate) -
Bosnjak1 - 23.11.2013
Good work mate.
Re: Anti Bike Bunny Hop (Accurate) -
dakata994 - 23.11.2013
It's good for RP servers as DanishHaq said . Well done nice job .