Spawn cars always in front of player, no matter what direction.
#1

I want to spawn cars always in front of the player, no matter what direction they are facing. Because if i just face forward, it works, it spawns in front of me. But if i look left, it will spawn just near me instead of in front.

Can somebody help?
This is my code;

pawn Код:
new Float:Angle;
GetPlayerFacingAngle(playerid, Angle);
new SpawnedVeh = CreateVehicle(VehicleToSpawn, x, y+4, z, Angle, 0, 0, 99999999999999999999999999999);
VehicleToSpawn is Retrieved from the DCMD params.

Thnx!
Reply
#2

try changing the x.
Reply
#3

pawn Код:
new Float:Angle;
GetPlayerFacingAngle(playerid, Angle);
new SpawnedVeh = CreateVehicle(VehicleToSpawn, x + 3 * floatsin(-Angle, degrees), y + 3 * floatcos(-Angle, degrees), z, Angle, 0, 0, 99999999999999999999999999999);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)