GetClosestPlayer
#5

I have a function that works like this:

pawn Код:
stock ProxDetectorS(Float:radi, playerid, targetid)  //[GameMode] The GodFather Function
{
    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;
}
I hope that i have helped
Reply


Messages In This Thread
GetClosestPlayer - by armyoftwo - 23.12.2010, 10:18
Re: GetClosestPlayer - by cessil - 23.12.2010, 10:25
Re: GetClosestPlayer - by armyoftwo - 23.12.2010, 10:30
Re: GetClosestPlayer - by cessil - 23.12.2010, 10:45
Re: GetClosestPlayer - by rjjj - 23.12.2010, 11:33
Re: GetClosestPlayer - by armyoftwo - 24.12.2010, 13:36
Re: GetClosestPlayer - by The_Gangstas - 24.12.2010, 14:12

Forum Jump:


Users browsing this thread: 1 Guest(s)