/rob closest player help
#6

pawn Код:
new Float:dist = 1000.0;
WHAT THE FUCK?

pawn Код:
stock GetNearestPlayer(playerid)
{
    new Float:arr1[3], Float:arr2[3];
    GetPlayerPos(playerid, arr1[0], arr1[1], arr1[2]);
    for(new i; i <MAX_PLAYERS; i++)
    {
        if(i == playerid) continue;
        GetPlayerPos(i, arr2[0], arr2[1], arr2[2]);
        if(2.0 /* DISTANCE */ < floatsqroot(floatpower(floatabs(floatsub(arr1[0], arr2[0])),2)+floatpower(floatabs(floatsub(arr1[1], arr2[1])),2)+floatpower(floatabs(floatsub(arr1[2], arr2[2])),2))){
            return i;
        }
    }
    return -1;
}
But, if you want /rob ID, you don't use this code (it detect the first player around you with a 2.0 radius)
Reply


Messages In This Thread
/rob closest player help - by AmirRFCNR - 29.08.2014, 15:30
Re: /rob closest player help - by Thogy - 29.08.2014, 15:42
Re: /rob closest player help - by BroZeus - 29.08.2014, 15:43
Re: /rob closest player help - by Stinged - 29.08.2014, 15:44
Re : /rob closest player help - by AmirRFCNR - 29.08.2014, 21:58
Re: /rob closest player help - by Noliax8 - 29.08.2014, 22:57
Re : /rob closest player help - by AmirRFCNR - 30.08.2014, 14:52
Re: /rob closest player help - by Lukka_Vercetti - 30.08.2014, 15:46
Re : Re: /rob closest player help - by AmirRFCNR - 30.08.2014, 16:23
Re: /rob closest player help - by Lukka_Vercetti - 30.08.2014, 16:29

Forum Jump:


Users browsing this thread: 1 Guest(s)