20.06.2017, 20:56
Hi guys, I know there are lots of threads about getting the position behind a vehicle but I just can't understand them and I wanna use them in OnPlayerKeyStateChange
Here is the code
Right now it spawns the barrel above the player's kart which sometimes makes it explode. I want it to spawn right behind the kart like -2 xy or something but I just can't figure out the formula.
Thanks in advance
Here is the code
PHP код:
new Float:VehicleX;
new Float:VehicleY;
new Float:VehicleZ;
new PlayerKartID = GetPlayerVehicleID(playerid);
GetVehiclePos(PlayerKartID, VehicleX, VehicleY, VehicleZ);
CreateObject(1225, VehicleX, VehicleY, VehicleZ+1, 0.0, 0.0, 125.0);
Thanks in advance