09.03.2010, 15:59
pawn Код:
forward PlayerToPoint(Float:radi, playerid, Float:xx, Float:yy, Float:zz);
public PlayerToPoint(Float:radi, playerid, Float:xx, Float:yy, Float:zz)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -xx);
tempposy = (oldposy -yy);
tempposz = (oldposz -zz);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}