If a player is Close
#2

pawn Код:
stock IsPlayerClose(playerid, Float:radi)
{
  new Float:oldposx, Float:oldposy, Float:oldposz;
  new Float:tempposx, Float:tempposy, Float:tempposz;
  new Float:otherx, Float:othery, Float:otherz;
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
    if(IsPlayerConnected(i))
    {
      GetPlayerPos(playerid, oldposx, oldposy, oldposz);
      GetPlayerPos(i, otherx, othery, otherz);
      tempposx = (oldposx -otherx);
      tempposy = (oldposy -othery);
      tempposz = (oldposz -otherz);
      if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
      {
        return 1;
      }
    }
  }
  return 0;
}
Reply


Messages In This Thread
If a player is Close - by [SOB]Chris - 18.09.2009, 03:09
Re: If a player is Close - by Correlli - 18.09.2009, 04:42

Forum Jump:


Users browsing this thread: 1 Guest(s)