object spawns infront of me when in vehicle - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: object spawns infront of me when in vehicle (
/showthread.php?tid=266627)
object spawns infront of me when in vehicle -
swieberdevos - 05.07.2011
nvm fixed
Re: object spawns infront of me when in vehicle -
Vince - 05.07.2011
pawn Код:
GetXYBehindPlayer(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);
}
a = a - 180; // <===
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
}
Re: object spawns infront of me when in vehicle -
HayZatic - 05.07.2011
use the etXYBehindPlayer(playerid, &Float
![angry](images/smilies/mad.gif)
, &Float:y, Float:distance)