SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 04/02/2010, 05:39 AM   #1
arnutisz
Big Clucker
 
Join Date: Nov 2007
Posts: 188
Reputation: 0
Default Player angle and walls detection

Is it possible to do these things in sa-mp:
- Detect the wall in front of you, or any kind of object that is not created by server?
- Set player or vehicle X, Y angle?

If its not possible with pawn, maybe possible with plugin?
arnutisz is offline  
Old 04/02/2010, 05:44 AM   #2
Joe Staff
High-roller
 
Join Date: Aug 2007
Posts: 2,593
Reputation: 379
Default Re: Player angle and walls detection

well, you might with the first one. using a map scale you can detect if the map infront of the player has a Z coordinate higher than the player.
Joe Staff is offline  
Old 04/02/2010, 07:41 AM   #3
ettans
Huge Clucker
 
ettans's Avatar
 
Join Date: Feb 2008
Posts: 388
Reputation: 29
Default Re: Player angle and walls detection

You could try to implement this with Joe Staff's suggestion. Though you'd need to make sure the object is not a mountain.
__________________
ettans is offline  
Old 04/02/2010, 11:37 AM   #4
arnutisz
Big Clucker
 
Join Date: Nov 2007
Posts: 188
Reputation: 0
Default Re: Player angle and walls detection

And what about X, Y angle? Any suggestions?
arnutisz is offline  
Old 04/02/2010, 11:39 AM   #5
Correlli
Godfather
 
Correlli's Avatar
 
Join Date: May 2009
Location: Slovenia
Posts: 6,340
Reputation: 365
Default Re: Player angle and walls detection

Quote:
Originally Posted by Scott[LT
]
- Set player or vehicle X, Y angle?
No, you can only set/get the Z angle.
Correlli is offline  
Old 04/02/2010, 11:56 AM   #6
mansonh
Gangsta
 
Join Date: Jun 2009
Posts: 602
Reputation: 0
Default Re: Player angle and walls detection

as for detecting walls etc
There is a mysql database plugin which has map heights, so you can find the z coordinate which includes building tops etc.
[REL,beta] MapAndreas plugin v1.0

So to detect a wall use this function with distance to detect a wall(think its ******'s code):
Code:
stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
	new Float:a;
	GetPlayerPos(playerid, x, y, a);
	GetPlayerFacingAngle(playerid, a);
	x += (distance * floatsin(-a, degrees));
	y += (distance * floatcos(-a, degrees));
}
Then use the mysql to determine the z coordinate, if its higher than you are, you have a wall.
__________________
mansonh is offline  
 

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
[HELP] How can i add walls Etc, On my server? PROSdontalkSHIT Help Archive 2 11/04/2010 05:25 PM
Set Player Angle from Camera VirSpectorX Help Archive 3 28/03/2010 12:43 PM
Help!! Some Vehicles on walls! _ASUS_ Help Archive 0 30/07/2009 10:56 PM
Trigonometric functions- get angle from player to point. robhol Help Archive 20 16/02/2009 05:43 PM


All times are GMT. The time now is 05:41 PM.


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