How do I spawn a vehicle infront of me?
#9

Quote:
Originally Posted by Rajat_Pawar
Посмотреть сообщение
Maybe... you should read the [optional] sign.
Quote:
Originally Posted by Rajat_Pawar
Посмотреть сообщение
1) GetPlayerPos
2) new vehicle = CreateVehicle(..);
3) [OPTIONAL] PutPlayerInVehicle(vehicle, ..);

Simple!
That creates a vehicle ON TOP of player. NOT infront of player.

Btw, this would help
pawn Код:
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
    new Float:a;
    GetPlayerPos(playerid, x, y, a);
    GetPlayerFacingAngle(playerid, a);
    if (GetPlayerVehicleID(playerid))
    {
        GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    }
    x += (distance * floatsin(-a, degrees));
    y += (distance * floatcos(-a, degrees));
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)