GetClosestPlayer returns always 0 ?
#2

pawn Код:
stock GetClosestPlayer(playerid) //By Slick (edited by Gabriel "Larcius" Cordes)
{
    if(IsPlayerConnected(playerid) && IsPlayerConnected(0))
    {
        new closestplayer=0;
        new Float:closestdist=GetDistanceBetweenPlayers(playerid,0);
        for(new playerid2=0; playerid2<MAX_PLAYERS; playerid2++)
        {
            new Float:dist = GetDistanceBetweenPlayers(playerid,playerid2);
            if ((dist < closestdist))
            {
                closestdist = dist;
                closestplayer = playerid;
            }
        }
        return closestplayer;
    }
    return -1;
}
Lol at the guy who wrote/edited this function.
Reply


Messages In This Thread
GetClosestPlayer returns always 0 ? - by Vince - 28.02.2009, 16:21
Re: GetClosestPlayer returns always 0 ? - by Nubotron - 28.02.2009, 16:34
Re: GetClosestPlayer returns always 0 ? - by 1337pr0 - 01.03.2009, 02:19

Forum Jump:


Users browsing this thread: 1 Guest(s)