SA-MP Forums Archive
Help with GetPlayerCameraFrontVector - 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)
+--- Thread: Help with GetPlayerCameraFrontVector (/showthread.php?tid=511471)



Help with GetPlayerCameraFrontVector - palesz_88 - 05.05.2014

Hello guys.

I've started to make an AC-130 like script, where you can shoot from a plane. So i attached an object to a plane what is driven by an other player and i attached the camera to the object. I made the a code like this for shooting missiles:

Код:
		if(PRESSED(KEY_FIRE))
		{
			new Float:x, Float:y, Float:z, Float:camx, Float:camy, Float:camz;
		    GetPlayerCameraPos(playerid, x, y, z);
		    GetPlayerCameraFrontVector(playerid, camx, camy, camz);

			gGunshipRocket = CreateObject(345, x, y, z, 0.0, 0.0, 500.0);
			
			//SetObjectFaceCoords3D(gGunshipRocket, camx, camy, camz); // a 3rd party stock for changing the rocket's facing
			
			MoveObject(gGunshipRocket, camx, camy, camz, 50);
			
		}
So my problem is that the rocket is flying to an exact position every time and not where i'm amining at.
Anybody can help?