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

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;
}
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: 2 Guest(s)