MySQL question
#2

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;
    }
}
Reply


Messages In This Thread
MySQL question - by AndreiWow - 10.02.2017, 08:53
Re: MySQL question - by Misiur - 10.02.2017, 08:58
Re: MySQL question - by BroZeus - 10.02.2017, 09:01

Forum Jump:


Users browsing this thread: 2 Guest(s)