Player angle and walls detection
#1

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?
Reply
#2

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.
Reply
#3

You could try to implement this with Joe Staff's suggestion. Though you'd need to make sure the object is not a mountain.
Reply
#4

And what about X, Y angle? Any suggestions?
Reply
#5

Quote:
Originally Posted by Scott[LT
]
- Set player or vehicle X, Y angle?
No, you can only set/get the Z angle.
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)