/arrest still not working
#5

Try this for a closestwanted player, just tweak it how you want it, seems to work for me.
pawn Код:
stock GetClosestWantedPlayer(playerid) //By Slick (edited by Gabriel "Larcius" Cordes and Salmon)
{
    if(IsPlayerConnected(playerid) && IsPlayerConnected(0))
    {
        new closestplayer=0;
        new Float:closestdist=GetDistanceBetweenPlayers(playerid,0);
        for(new playerid2=0; playerid2<MAX_PLAYERS; playerid2++)
        {
        if(gTeam[playerid2] == TEAM_CRIMS)
        {
            new Float:dist = GetDistanceBetweenPlayers(playerid,playerid2);
            if ((dist < closestdist))
            {
                closestdist = dist;
                closestplayer = playerid;
            }
        }
        }
        return closestplayer;
    }
    return -1;
}
Reply


Messages In This Thread
/arrest still not working - by StrickenKid - 25.02.2009, 22:47
Re: /arrest still not working - by brett7 - 25.02.2009, 23:43
Re: /arrest still not working - by StrickenKid - 26.02.2009, 00:00
Re: /arrest still not working - by Jefff - 26.02.2009, 00:24
Re: /arrest still not working - by Salmon - 26.02.2009, 02:00

Forum Jump:


Users browsing this thread: 1 Guest(s)