SA-MP Forums Archive
[HELP] Moving camera position - 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: [HELP] Moving camera position (/showthread.php?tid=185666)



[HELP] Moving camera position - gamer931215 - 25.10.2010

Hello guys, i need a little bit help here.

i am working on an apache board cannon

Preview:
[ame]http://www.youtube.com/watch?v=Y_NTV8HPVUM[/ame]

But like you see, you can move the camera position to X and Y, but i want it upwards and downwards just like the camera position is (so not when you are facing south, that the camera goes north)

Is there any formule/method to get the position of up/down/left/right ?


Re: [HELP] Moving camera position - Hiddos - 25.10.2010

If you're using the GetPlayerCameraPos function, just adjust the Z value ^^

Edit: Or do you mean as in rotating the camera's point to look at (Straight-forward, half-way down and stuff)? Then use SetPlayerCameraLookAt

Note that there isn't a "Get" function for it, so store the parameters in variables if you're going to use them later on.


Re: [HELP] Moving camera position - Tannz0rz - 25.10.2010

I made a Lockheed AC-130U Spooky FS awhile ago but had no use for it. It isn't fully optimized, though I've tested it on a live server and everything seems to work fine.

Just walk up to a Shamal and press G. Since you're the gunner, someone else will have to pilot it (though you could make it work otherwise). And then you just use your up/down and left/right keys to look around and fire to shoot off bursts of minigun rounds.

Anyways, here it is:
http://solidfiles.com/d/975d0/

EDIT: It requires MapAndreas by the way.


Re: [HELP] Moving camera position - gamer931215 - 25.10.2010

Quote:
Originally Posted by Hiddos
Посмотреть сообщение
If you're using the GetPlayerCameraPos function, just adjust the Z value ^^
But Z is height isnt it ? or will the camera will go up/down if i adjust that ?
Also any idea to adjust left/right ?


Re: [HELP] Moving camera position - Hiddos - 25.10.2010

Quote:
Originally Posted by gamer931215
Посмотреть сообщение
But Z is height isnt it ? or will the camera will go up/down if i adjust that ?
Also any idea to adjust left/right ?
Nope, use SetPlayerCameraLookAt. I was kinda confused when you were telling me the problem ^^ (Check my 1st post)


Re: [HELP] Moving camera position - gamer931215 - 25.10.2010

Quote:
Originally Posted by Hiddos
Посмотреть сообщение
Nope, use SetPlayerCameraLookAt. I was kinda confused when you were telling me the problem ^^ (Check my 1st post)
I use that, but X and Y are not always the way the player looks. If the player is facing south as example the camera will go the wrong way. Thats what i mean how to fix that ?


Re: [HELP] Moving camera position - Hiddos - 25.10.2010

Quote:
Originally Posted by gamer931215
Посмотреть сообщение
I use that, but X and Y are not always the way the player looks. If the player is facing south as example the camera will go the wrong way. Thats what i mean how to fix that ?
Using GetVehicleZAngle in combination with floatsin/cos?

I might try helping it a hand, add me on MSN if you're interested (Found in my contact details of my profile).