Posts: 724
Threads: 62
Joined: Dec 2008
Reputation:
0
How can I check if a player is at a specific height.
Like let's say i want to respawn someone if their height is 535.2068?
And is there a better way to check other than using a timer...?
Posts: 6,129
Threads: 36
Joined: Jan 2009
OnPlayerUpdate, technically still using a timer. And probably a waste of code.
Posts: 6,129
Threads: 36
Joined: Jan 2009
Quote:
Originally Posted by Memoryz
Quote:
Originally Posted by CalgonX
OnPlayerUpdate, technically still using a timer. And probably a waste of code.
|
Not a waste, if you're at a specific height, you win the game, and you get spawned to the lobby...
So how would I go about doing this then?
|
pawn Код:
public OnPlayerUpdate(playerid)
{
New Float: PX, Float: PY, Float: PZ;
GetPlayerPos(playerid, PX, PY, PZ);
if(PX == 535.2068)
{
return 0;
}
else
{
return 1;
}
}
Something like that. FYI, Y is height though.
Y^
X>
Z
(down)
Posts: 899
Threads: 54
Joined: May 2009
Reputation:
0
AddPlayerClass(170,535.2068,-2101.1238,-0.6810,279.2928,0,0,0,0,0,0);
The bold is the height, btw Calgon. You were checking the X not the Z.