IsPlayerIn2DRadius
#2

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;
}
now use it like
pawn Код:
if(PlayerToPoint(radi,playerid,x,y))
{
//your code
}
else
{
//your message
}
radi is your meter radius
Reply


Messages In This Thread
IsPlayerIn2DRadius - by MP2 - 14.06.2012, 07:16
Re: IsPlayerIn2DRadius - by mineralo - 14.06.2012, 08:12

Forum Jump:


Users browsing this thread: 1 Guest(s)