[FilterScript] Anti Bike Bunny Hop (Accurate)
#1

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
Reply


Messages In This Thread
Anti Bike Bunny Hop (Accurate) - by Patrick - 30.09.2013, 21:14
Re: Anti Bike Bunny Hop (Accurate) - by BodyBoardVEVO - 30.09.2013, 21:19
Re: Anti Bike Bunny Hop (Accurate) - by Team_PRO - 30.09.2013, 22:04
Re: Anti Bike Bunny Hop (Accurate) - by Patrick - 30.09.2013, 22:14
Re: Anti Bike Bunny Hop (Accurate) - by PT - 30.09.2013, 23:32
Re: Anti Bike Bunny Hop (Accurate) - by Jefff - 01.10.2013, 00:08
Re: Anti Bike Bunny Hop (Accurate) - by Team_PRO - 01.10.2013, 01:09
Re: Anti Bike Bunny Hop (Accurate) - by Patrick - 01.10.2013, 14:03
Re: Anti Bike Bunny Hop (Accurate) - by xganyx - 01.10.2013, 14:10
Re: Anti Bike Bunny Hop (Accurate) - by n0minal - 01.10.2013, 15:46
Re: Anti Bike Bunny Hop (Accurate) - by Patrick - 04.10.2013, 22:46
Re: Anti Bike Bunny Hop (Accurate) - by mini_mi - 05.10.2013, 03:06
Re: Anti Bike Bunny Hop (Accurate) - by Patrick - 05.10.2013, 11:53
Re: Anti Bike Bunny Hop (Accurate) - by Rube - 08.10.2013, 17:52
Re: Anti Bike Bunny Hop (Accurate) - by Patrick - 14.10.2013, 22:12
Re: Anti Bike Bunny Hop (Accurate) - by DanishHaq - 14.10.2013, 22:49
Re: Anti Bike Bunny Hop (Accurate) - by Patrick - 14.10.2013, 22:54
Re: Anti Bike Bunny Hop (Accurate) - by DowDaw - 22.11.2013, 22:41
Re: Anti Bike Bunny Hop (Accurate) - by Bosnjak1 - 23.11.2013, 00:15
Re: Anti Bike Bunny Hop (Accurate) - by dakata994 - 23.11.2013, 06:37

Forum Jump:


Users browsing this thread: 1 Guest(s)