Deathmatch Zone
#7

pawn Код:
public TestDistance(playerid,giveplayerid,Float:tarx,Float:tary,Float:tarz,Float:radi)
{
    if (gdebug >= 3){printf("DEBUG TestDistance()");}
    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(giveplayerid, posx, posy, posz);
    tempposx = (tarx -oldposx);
    tempposy = (tary -oldposy);
    tempposz = (tarz -oldposz);
    //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
    if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
    {
        if (gdebug >= 2){printf("DEBUG TestDistance2()");}
        tempposx = (tarx -posx);
        tempposy = (tary -posy);
        tempposz = (tarz -posz);
        if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
        {
            if (gdebug >= 2){printf("DEBUG TestDistance3()");}
            return 1;
        }
    }
    else
    {
        return 0;
    }
    return 0;
}
Reply


Messages In This Thread
Deathmatch Zone - by joeri55 - 19.06.2009, 18:22
Re: Deathmatch Zone - by dice7 - 19.06.2009, 18:42
Re: Deathmatch Zone - by joeri55 - 19.06.2009, 21:57
Re: Deathmatch Zone - by dice7 - 19.06.2009, 22:07
Re: Deathmatch Zone - by joeri55 - 19.06.2009, 22:15
Re: Deathmatch Zone - by dice7 - 19.06.2009, 22:22
Re: Deathmatch Zone - by joeri55 - 19.06.2009, 22:29
Re: Deathmatch Zone - by joeri55 - 20.06.2009, 17:08

Forum Jump:


Users browsing this thread: 1 Guest(s)