30.01.2010, 14:51
currently i have this:
But now it spawns left of me. But what's the correct coordinates to make it spawn infront of me?
Код:
X+6,Y,Z+1
X+6,Y,Z+1
new get; get = GetPlayerZAngel ( or smth ) blablabla... AddStaticVehicle/Ex(x+bla,y+bla+bla,z+bla,get+3 , blalbalba)
forward Float:GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance);
stock Float:GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
new Float:a;
GetPlayerPos(playerid, x, y, a);
if (IsPlayerInAnyVehicle(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
else GetPlayerFacingAngle(playerid, a);
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
return a;
}
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z); // to get Z
GetXYInFrontOfPlayer(playerid,x,y,2.0);
CreateVehicle(blablabla X,Y,Z...);