21.07.2018, 09:10
Hello, I try to do a speed boost to the forward with car.
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_CTRL_BACK)
{
if(IsPlayerInAnyVehicle(playerid))
{
new Float: vX, Float: vY, Float: vZ;
GetPlayerVelocity(playerid, vX, vY, vZ);
SetPlayerVelocity(playerid, vX + 5.0, vY , vZ);
}
}
return 1;
}
This Boost works just in x coordinate, but I want what ot work to the forward of player. How I can change direction?
Sorry for my bad english
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_CTRL_BACK)
{
if(IsPlayerInAnyVehicle(playerid))
{
new Float: vX, Float: vY, Float: vZ;
GetPlayerVelocity(playerid, vX, vY, vZ);
SetPlayerVelocity(playerid, vX + 5.0, vY , vZ);
}
}
return 1;
}
This Boost works just in x coordinate, but I want what ot work to the forward of player. How I can change direction?
Sorry for my bad english