14.06.2012, 08:12
pawn Код:
stock PlayerToPoint(Float:radi, playerid, Float:x, Float:y)
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)))
{
return 1;
}
return 0;
}
pawn Код:
if(PlayerToPoint(radi,playerid,x,y))
{
//your code
}
else
{
//your message
}