SA-MP Forums Archive
some questions - 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: some questions (/showthread.php?tid=629649)



some questions - iTzMatheus - 01.03.2017

First - Hello everyone, a friend needs help. Today, I'm trying to create a vehicle annouce system, a simple system for players from my server. How can I get the perfect coordinate of the vehicle? I want the central coordinate from vehicle and others coordinates too.

Second - I'm creating a new login screen and I really not know how to pick the correct camera position. I'm trying to put the player's camera looking at a house but when I put the coordinate using the function (SetPlayerPos, SetPlayerCameraPos and SetPlayerCameraLookAt) the position is looking for the floor.

Third - I'm looking for a School system. If the player exit the school, the time is over and he needs return and start all again. How can I do this?


Thank for all, I'm waiting for help. See ya'


Re: some questions - OneDay - 01.03.2017

The camera cannot look at the same position it is, look at a different coordinates.


Re: some questions - iTzMatheus - 01.03.2017

Quote:
Originally Posted by OneDay
Посмотреть сообщение
The camera cannot look at the same position it is, look at a different coordinates.
right, but, how can I get the correct coordinate? I don't know how to do this.


Re: some questions - Alkymia - 02.03.2017

Take a look on this for your 2nd question


Re: some questions - CXdur - 02.03.2017

1. What do you mean the perfect coordinate of the vehicle? Where it spawns or where it currently is? If you'd like to know where it spawns I'm not sure if you're able to do this without hooking functions and such. I'm not sure though, just don't think there are inbuilt functions to get the spawn coordinates. You can however get the vehicle's current position or save it's spawn position with hooks, and if you'd like the float to look better you can always limit the amount of decimals to 2 by doing for instance:

%0.2f instead of %f

I'm not sure if that's what you meant by perfect though, you need to be more specific.

2:

You have to set the camera's position somewhere different. Let's say you'd like to look straight down at a player, you'd use his coordinates but increase the Z position by a bit. I think you should be able to figure out the rest yourself then.