SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 02/02/2020, 02:03 AM   #1
tippythop
Little Clucker
 
Join Date: Oct 2008
Posts: 44
Reputation: 1
Default Help with player orientation when entering interior

I need some help with figuring out how to make the player orientation face forward when entering an interior checkpoint. The current script just uses an XYZ for enter and exit checkpoints. Anytime a player enters an interior sometimes it will face them sideways or complete 180 facing the exit door.
tippythop is offline   Reply With Quote
Old 02/02/2020, 07:26 AM   #2
pollo97
Big Clucker
 
pollo97's Avatar
 
Join Date: Sep 2011
Location: Italy
Posts: 83
Reputation: 4
Default Re: Help with player orientation when entering interior

As far as i know, there isn't a way do to automatically. So for every interior, in addition to XYZ coordinates, i save also the player facing angle.

Btw i think it's the wrong section.
pollo97 is offline   Reply With Quote
Old 02/02/2020, 11:12 PM   #3
tippythop
Little Clucker
 
Join Date: Oct 2008
Posts: 44
Reputation: 1
Default Re: Help with player orientation when entering interior

Sorry about that if its the wrong section so this line of code goes like this:

Code:
CreateEntrance( "", -2242.1438, -88.0866, 35.3203, 501.9013, -67.5635, 998.7578, 			11,  1, false, false, 49 );//MISTY'S
And the sql rows like this:

Code:
CreateEntrance( label,
				cache_get_field_content_float( i, "X", dbHandle ),
				cache_get_field_content_float( i, "Y", dbHandle ),
				cache_get_field_content_float( i, "Z", dbHandle ),
				cache_get_field_content_float( i, "EX", dbHandle ),
				cache_get_field_content_float( i, "EY", dbHandle ),
				cache_get_field_content_float( i, "EZ", dbHandle ),
				cache_get_field_content_int( i, "INTERIOR", dbHandle ),
				cache_get_field_content_int( i, "WORLD", dbHandle ),
				!!cache_get_field_content_int( i, "CUSTOM", dbHandle ),
				!!cache_get_field_content_int( i, "VIP_ONLY", dbHandle ),
				cache_get_field_content_int( i, "MAP_ICON", dbHandle ),
Where would I got about adding facing angle?
tippythop is offline   Reply With Quote
Old 03/02/2020, 03:33 PM   #4
pollo97
Big Clucker
 
pollo97's Avatar
 
Join Date: Sep 2011
Location: Italy
Posts: 83
Reputation: 4
Default Re: Help with player orientation when entering interior

First you've to change the function parameters of "CreateEntrance" into something like this:

Code:
CreateEntrance(label[],Float:X,Float:Y,Float:Z,Float:fAngle,Float:Ex,Float:Ey,Float:Ex,Float:EfAngle,interior,world,costum,viponly,mapicon);
For the SQL you must create two new columns in the "entrance table", so modify the data retrieve into this:

Code:
CreateEntrance( label,
				cache_get_field_content_float( i, "X", dbHandle ),
				cache_get_field_content_float( i, "Y", dbHandle ),
				cache_get_field_content_float( i, "Z", dbHandle ),
                                cache_get_field_content_float( i, "FAngle", dbHandle ),
				cache_get_field_content_float( i, "EX", dbHandle ),
				cache_get_field_content_float( i, "EY", dbHandle ),
				cache_get_field_content_float( i, "EZ", dbHandle ),
                                cache_get_field_content_float( i, "EFAngle", dbHandle ),
				cache_get_field_content_int( i, "INTERIOR", dbHandle ),
				cache_get_field_content_int( i, "WORLD", dbHandle ),
				!!cache_get_field_content_int( i, "CUSTOM", dbHandle ),
				!!cache_get_field_content_int( i, "VIP_ONLY", dbHandle ),
				cache_get_field_content_int( i, "MAP_ICON", dbHandle ),
Where FAngle and EFAngle are your new columns.

So now i don't know how you create for the first time the entrance, but anyway here you've got to insert the correct player facing angle. So if you do it automatically, go and type the game command looking in the opposite direction of the door, but if you insert manually into database, get the correct face aiming using /save (it's stored in Documents\GTA San Andreas User Files\SAMP\savedpositions.txt) and the save it in the entrance table.

I don't know if the last part it's clear enough, but let me know.
pollo97 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delay when entering/exiting interior FikusBL Scripting Help 9 09/06/2018 11:34 PM
Entering a Interior ChandraLouis Scripting Help 8 27/04/2017 02:42 PM
Problem, while entering interior. AA9 Scripting Help 5 13/09/2013 07:28 PM
Player Protection. Like Protection when entering checkpoint. and interior. stevestelford Scripting Help 2 08/06/2012 12:03 AM
Problem with entering into the interior Petricko Scripting Help 7 11/04/2012 01:12 AM


All times are GMT. The time now is 02:45 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.