/parole problem
#4

Use ProxdetectorS instead.


pawn Код:
//At the top:
forward ProxDetectorS(Float:radi, playerid, targetid);

//Anywehre else
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);
        //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
        if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
        {
            return 1;
        }
    }
    return 0;
}
So then instead of using GetPlayerPos, do like this:

pawn Код:
if(!ProxDetectorS(5.0, playerid,id)) // change the 5.0 for how many meters around that should be available
Reply


Messages In This Thread
/parole problem - by Pawno_Master - 21.07.2009, 08:49
Re: /parole problem - by Sdhoirm - 21.07.2009, 09:21
Re: /parole problem - by yezizhu - 21.07.2009, 09:25
Re: /parole problem - by Klutty - 21.07.2009, 09:33
Re: /parole problem - by Pawno_Master - 21.07.2009, 10:12
Re: /parole problem - by woot - 21.07.2009, 11:03
Re: /parole problem - by Pawno_Master - 21.07.2009, 11:17
Re: /parole problem - by woot - 21.07.2009, 11:20

Forum Jump:


Users browsing this thread: 1 Guest(s)