Player Angles - 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: Player Angles (
/showthread.php?tid=252130)
Player Angles -
Lorenc_ - 30.04.2011
Hai, i tried several times with a player to try get this object to move where the player is facing, not where hes camera is facing.
Just like when someone types /air there will be a hugeass plane going past him though im wanting the plane to fly towards where he faces (THE PLAYER once again not the Players Camera)
If anyone knows how to do this, me and a friend tried, failed for us
pawn Код:
gPlayerData[playerid][E_AIRSTRIKE_AROMANDA] = CreateObject(14553,pos[0]-60, pos[1],pos[2]+80,0, 0, 90);
MoveObject(gPlayerData[playerid][E_AIRSTRIKE_AROMANDA], pos[0] + 260, pos[1], pos[2] + 80, 30);
Edit:
To Example Completely
Well i want the plane in the code to basicly face and fly the way the players angle
Re: Player Angles -
Lorenc_ - 01.05.2011
bump
Re: Player Angles -
MadeMan - 01.05.2011
Use GetXYInFrontOfPlayer
pawn Код:
GetXYInFrontOfPlayer(playerid, pos[0], pos[1], 100.0);
MoveObject(gPlayerData[playerid][E_AIRSTRIKE_AROMANDA], pos[0], pos[1], pos[2] + 80, 30);
pawn Код:
stock 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));
}
Re: Player Angles -
Lorenc_ - 01.05.2011
That isn't working either, lol im so raging over this
Re: Player Angles -
Lorenc_ - 02.05.2011
BUMP