If player is close to other player (help)
#3

pawn Код:
IsPlayerNearPlayer(Float:radi, playerid, targetid)
{
  if(IsPlayerConnected(playerid) && IsPlayerConnected(targetid))
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        GetPlayerPos(targetid, posx, posy, posz);
        tempposx = (oldposx -posx);
        tempposy = (oldposy -posy);
        tempposz = (oldposz -posz);
        if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
        {
            return 1;
        }
    }
    return 0;
}
Reply


Messages In This Thread
If player is close to other player (help) - by Yoyoyo - 01.03.2009, 22:06
Re: If player is close to other player (help) - by Rks25 - 01.03.2009, 22:07
Re: If player is close to other player (help) - by 1337pr0 - 02.03.2009, 00:19

Forum Jump:


Users browsing this thread: 2 Guest(s)