[FilterScript] [FS] Burnout v2 [for SA:MP 0.3 and up]
#33

I made my own little version, I find this one alot better
pawn Code:
#define BURNOUT_INDEX 0.015

forward BurnoutFunc(playerid, vehicleid);
public BurnoutFunc(playerid, vehicleid)
{
    PlayerInfo[playerid][pBurnout]++;
    new keys, ud, lr;
    GetPlayerKeys(playerid, keys, ud, lr);
    if(PlayerInfo[playerid][pBurnout] > 10 && keys == 8)//VEHICLE_ACCELERATE
    {
        if(PlayerInfo[playerid][pBurnout] > 30) PlayerInfo[playerid][pBurnout] = 30;
        new Float:speed[2];
        GetXYInFrontOfVehicle(vehicleid, speed[0], speed[1], BURNOUT_INDEX * PlayerInfo[playerid][pBurnout]);
        AccelerateTowardsAPoint(vehicleid, speed[0], speed[1]);
        PlayerInfo[playerid][pBurnout] = 0;
        KillTimer(PlayerInfo[playerid][pBurnoutTimer]);
    }
    if(keys == ( KEY_SPRINT | KEY_JUMP )) return 1;//keys are still accelerating and braking
    if(keys != ( KEY_SPRINT | KEY_JUMP ) && keys != 8)//keys are now not related to accelerate and brake
    {
        PlayerInfo[playerid][pBurnout] = 0;
        KillTimer(PlayerInfo[playerid][pBurnoutTimer]);
    }
    return 1;
}

#define TURBO_DEDUCT_INDEX 135
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if ((newkeys & KEY_SPRINT) && (newkeys & KEY_JUMP) && IsPlayerInAnyVehicle(playerid))
    {
        PlayerInfo[playerid][pBurnout]++;
        PlayerInfo[playerid][pBurnoutTimer] = SetTimerEx("BurnoutFunc", 100, true, "ii", playerid, Current_Vehicle[playerid]);
    }
    if (RELEASED( KEY_SPRINT | KEY_JUMP ) && !(newkeys & 8))
    {
        if (IsPlayerInAnyVehicle(playerid) && PlayerInfo[playerid][pBurnout] > 0)
        {
            PlayerInfo[playerid][pBurnout] = 0;
            KillTimer(PlayerInfo[playerid][pBurnoutTimer]);
        }
    }
    return 1;
}
Theres a bug in yours, once you hit 10 burnout, it does the burnout

if (RELEASED( KEY_SPRINT | KEY_JUMP ) && !(newkeys & ) fixes it
Reply


Messages In This Thread
[FS] Burnout v2 [for SA:MP 0.3 and up] - by KKashimia - 03.12.2009, 07:08
Re: [FS] Burnout - by pliva_sb - 03.12.2009, 07:50
Re: [FS] Burnout - by KKashimia - 03.12.2009, 07:59
Re: [FS] Burnout [for SA:MP 0.3 and up] - by Maniek - 03.12.2009, 08:22
Re: [FS] Burnout [for SA:MP 0.3 and up] - by KKashimia - 03.12.2009, 08:33
Re: [FS] Burnout [for SA:MP 0.3 and up] - by Maniek - 03.12.2009, 08:56
Re: [FS] Burnout [for SA:MP 0.3 and up] - by KKashimia - 03.12.2009, 08:59
Re: [FS] Burnout [for SA:MP 0.3 and up] - by Maniek - 03.12.2009, 09:06
Re: [FS] Burnout [for SA:MP 0.3 and up] - by KKashimia - 03.12.2009, 09:14
Re: [FS] Burnout [for SA:MP 0.3 and up] - by Cedimedi - 03.12.2009, 10:32
Re: [FS] Burnout [for SA:MP 0.3 and up] - by Headyheadster - 03.12.2009, 14:46
Re: [FS] Burnout [for SA:MP 0.3 and up] - by KKashimia - 03.12.2009, 17:30
Re: [FS] Burnout [for SA:MP 0.3 and up] - by Hollywood - 03.12.2009, 23:14
Re: [FS] Burnout [for SA:MP 0.3 and up] - by KKashimia - 04.12.2009, 08:37
Re: [FS] Burnout [for SA:MP 0.3 and up] - by RoamPT - 04.12.2009, 17:16
Re: [FS] Burnout v2 [for SA:MP 0.3 and up] - by Cedimedi - 04.12.2009, 18:35
Re: [FS] Burnout v2 [for SA:MP 0.3 and up] - by Sayaron - 04.12.2009, 19:03
Re: [FS] Burnout v2 [for SA:MP 0.3 and up] - by Lotusmp - 05.12.2009, 00:56
Re: [FS] Burnout v2 [for SA:MP 0.3 and up] - by Te3j4y - 05.12.2009, 05:51
Re: [FS] Burnout v2 [for SA:MP 0.3 and up] - by mister_ic3 - 05.12.2009, 13:03
Re: [FS] Burnout v2 [for SA:MP 0.3 and up] - by habl - 05.12.2009, 13:17
Re: [FS] Burnout v2 [for SA:MP 0.3 and up] - by [03]Garsino - 05.12.2009, 13:53
Re: [FS] Burnout v2 [for SA:MP 0.3 and up] - by KKashimia - 05.12.2009, 15:15
Re: [FS] Burnout v2 [for SA:MP 0.3 and up] - by arjunaryas - 30.12.2009, 09:41
Re: [FS] Burnout v2 [for SA:MP 0.3 and up] - by RenisiL - 30.12.2009, 09:46
Re: [FS] Burnout v2 [for SA:MP 0.3 and up] - by Nakki - 30.12.2009, 11:58
Re: [FS] Burnout v2 [for SA:MP 0.3 and up] - by SlashPT - 30.12.2009, 12:32
Re: [FS] Burnout v2 [for SA:MP 0.3 and up] - by Jakku - 03.01.2010, 12:17
Re: [FS] Burnout v2 [for SA:MP 0.3 and up] - by DRIFT_HUNTER - 03.01.2010, 13:12
Re: [FS] Burnout v2 [for SA:MP 0.3 and up] - by belzebul - 10.01.2010, 08:43
Re: [FS] Burnout v2 [for SA:MP 0.3 and up] - by mick88 - 22.01.2010, 09:20
Re: [FS] Burnout v2 [for SA:MP 0.3 and up] - by titanak - 28.02.2012, 00:15
Re: [FS] Burnout v2 [for SA:MP 0.3 and up] - by Kar - 28.02.2012, 01:52
Re: [FS] Burnout v2 [for SA:MP 0.3 and up] - by Detective- - 28.02.2012, 02:03
Re: [FS] Burnout v2 [for SA:MP 0.3 and up] - by [HK]Ryder[AN] - 28.02.2012, 03:07

Forum Jump:


Users browsing this thread: 5 Guest(s)