10.02.2017, 08:58
It will return only the lab you're in (unless a two labs are too close together). Your code loops through all labs, and checks if you are near it with IsPlayerInRangeOfPoint. Only change I'd suggest is adding break when a lab is found, so no more useless iterations are done
pawn Код:
for(new i = 0; i < MAX_DLABS; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 60.0, DrugLabs[i][ExitX], DrugLabs[i][ExitY], DrugLabs[i][ExitZ]))
{
format(string, sizeof(string), ""COL_ORANGE"DROGURI:\n__________\n", string);
format(string, sizeof(string), "%sHeroina: %d\n", string, DrugLabs[i][Heroina]);
format(string, sizeof(string), "%sHeroina: %d\n", string, DrugLabs[i][Heroina]);
break;
}
}