30.09.2013, 21:14
(
Last edited by Patrick; 17/12/2013 at 09:38 PM.
)
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
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
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;
}
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