Can you help me please?
#6

Add this on top of script
pawn Код:
forward ProxDetectorS(Float:radi, playerid, targetid);
Add this somewhere you want after OnGameModeInit or somefhing
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);
        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;
}
Usage of if(ProxDetectorS(8.0, playerid, targetid))
pawn Код:
8.0 = The Radius Like if the radius between the 2 varibles.
playerid = Player One You can use whatever you want
targetid = Player 2 You can use whatever you want here
It will get the distance of playerid and target name and if its true it will continue
Reply


Messages In This Thread
Can you help me please? - by imagician - 18.10.2011, 14:33
Re: Can you help me please? - by nilanjay - 18.10.2011, 14:42
AW: Can you help me please? - by imagician - 18.10.2011, 14:44
Re: Can you help me please? - by Jason_Thunde - 18.10.2011, 14:46
AW: Can you help me please? - by imagician - 18.10.2011, 19:44
Re: Can you help me please? - by Jason_Thunde - 18.10.2011, 19:49

Forum Jump:


Users browsing this thread: 3 Guest(s)