command help
#4

You can use PlayerToPoint

pawn Код:
if(PlayerToPoint(1.0, playerid, 338.4752,-2416.0164,14.2604))
You need this somewhere in your script:

pawn Код:
stock 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);
        if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
        {
            return 1;
        }
    }
    return 0;
}
Reply


Messages In This Thread
command help - by WardenCS - 23.07.2009, 17:50
Re: command help - by mprofitt - 23.07.2009, 17:59
Re: command help - by WardenCS - 23.07.2009, 18:00
Re: command help - by MadeMan - 23.07.2009, 22:43

Forum Jump:


Users browsing this thread: 1 Guest(s)