How can i make speed boost
#1

Well, i was wondering how to make a player able to boost his car by typing /ssb and when he types it, it gives him the abillity to left click to speed boost any help on how to make a player speed boost?
Reply
#2

https://sampwiki.blast.hk/wiki/SetVehicleVelocity
Reply
#3

whats one of them that gives you the actual speed boost?
Reply
#4

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        if(newkeys & KEY_FIRE)
        {
            if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            {
                new Float:x,Float:y,Float:z;
                GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z);
                SetVehicleVelocity(GetPlayerVehicleID(playerid), x * 1.0, y * 1.0, z * 1.0);
            }
        }
    }
    return 1;
}
Untested but it should work if you hit LMB
Reply
#5

Try like that
pawn Код:
new Float:x,Float:y,Float:z,Float:a,Float:distance = 0.27;
GetVehicleVelocity(vehicleid, x, y, z);
GetVehicleZAngle(vehicleid, a);
SetVehicleVelocity(vehicleid,floatadd(x,floatmul(distance,floatsin(-a,degrees))), floatadd(y,floatmul(distance,floatcos(-a,degrees))), z);
just increase distance for more boost power
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)