boost to be default situation
#1

I have this little fs for vehicle speed boost and no matter what I changed, didnt make the boost to be default.
pawn Код:
#include <a_samp>

new bool: EnableBoost[MAX_PLAYERS];

public OnFilterScriptInit()
{
    print("   Loaded successful.");
    return 1;
}


public OnPlayerConnect(playerid)
{
EnableBoost[playerid] = true;
return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/Boost", true)==0)
    {
        if(EnableBoost[playerid]==true)
        {
            EnableBoost[playerid] = false;
            SendClientMessage(playerid, 0x924161FF, "[ ! ] Boost Deactivated.");
        }
        else
        {
        EnableBoost[playerid] = true;
        SendClientMessage(playerid, 0x924161FF, "[ ! ] Boost Activated.");
        }
        return 1;
    }
    return 0;
}


public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (IsPlayerInAnyVehicle(playerid) || GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        if(newkeys & KEY_FIRE)
        {
            if(EnableBoost[playerid] == true)
            {
                new Float:vx,Float:vy,Float:vz;
                GetVehicleVelocity(GetPlayerVehicleID(playerid),vx,vy,vz);
                SetVehicleVelocity(GetPlayerVehicleID(playerid), vx * 1.3, vy *1.3, vz * 1.3);
            }
        }
    }
    return 0;
}
Reply
#2

Some help here. What I mean is that when I enter my server, the boost isnt applied. I need to type boost to enabe it. What I want is the boost to be already applied as soon as I enter my server.

EDIT: nevermind, somehow fixed even if I didn't change anything
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)