30.04.2013, 07:43
For a command such as /car and it will spawn a PD cruiser infront of me?
Maybe you should read what he wanted.
How do I spawn a vehicle infront of me? |
1) GetPlayerPos
2) new vehicle = CreateVehicle(..); 3) [OPTIONAL] PutPlayerInVehicle(vehicle, ..); Simple! |
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));
}