New command, help.
#2

Well you could use ProxDetectorS from godfather

pawn Код:
public ProxDetectorS(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);
        //radi = 2.0; //Trigger Radius
        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;
}
Then you could say

pawn Код:
for (new i = 0; i < MAX_PLAYERS; i++)
{
  if (ProxDetectorS(2.0, playerid, i)
  {
    // infect them.
  }
}
That should work.
Reply


Messages In This Thread
New command, help. - by Abernethy - 11.06.2009, 04:56
Re: New command, help. - by efeX - 11.06.2009, 05:30
Re: New command, help. - by Joe Staff - 11.06.2009, 06:06

Forum Jump:


Users browsing this thread: 1 Guest(s)