Run into a Wall..
#4

Try using PlayerToPoint by adding this function to your script
Код:
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
then adding the actual function
Код:
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
  if(IsPlayerConnected(playerid))
	{
		new Float:oldposx, Float:oldposy, Float:oldposz;
		new Float:tempposx, Float:tempposy, Float:tempposz;
		GetPlayerPos(playerid, oldposx, oldposy, oldposz);
		tempposx = (oldposx -x);
		tempposy = (oldposy -y);
		tempposz = (oldposz -z);
		//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
		if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
		{
			return 1;
		}
	}
	return 0;
}
Use it like so:
Код:
if(PlayerToPoint(20, i,1133.0699,-9.5731,1000.6797))
{//Restaurant Entrance
  GameTextForPlayer(i, "~Y~Restaurant, 5000, 1);
  SetPlayerInterior(i, 4);
  SetPlayerPos(i,1022.599975,-1123.699951,23.799999);
}
Reply


Messages In This Thread
Run into a Wall.. - by TheNotorius - 16.01.2010, 00:11
Re: Run into a Wall.. - by Fedee! - 16.01.2010, 00:16
Re: Run into a Wall.. - by [HiC]TheKiller - 16.01.2010, 01:20
Re: Run into a Wall.. - by SuperS82 - 16.01.2010, 05:50
Re: Run into a Wall.. - by V1ceC1ty - 16.01.2010, 05:59
Re: Run into a Wall.. - by TheNotorius - 16.01.2010, 06:06
Re: Run into a Wall.. - by jameskmonger - 16.01.2010, 06:10
Re: Run into a Wall.. - by TheNotorius - 16.01.2010, 06:12
Re: Run into a Wall.. - by SuperS82 - 16.01.2010, 06:39
Re: Run into a Wall.. - by TheNotorius - 17.01.2010, 07:14

Forum Jump:


Users browsing this thread: 1 Guest(s)