21.05.2015, 14:10
PHP код:
public InBusinessCheck(playerid)
{
Player[playerid][InBusiness] = -1;
for(new i = 0; i < sizeof(Businesses); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 3, Businesses[i][bInteriorX], Businesses[i][bInteriorY], Businesses[i][bInteriorZ]))
{
Player[playerid][InBusiness] = i;
break;
}
}
return 1;
}
EDIT: Actually 0 is a valid business ID so set it to -1. You must check if the variable is not -1 in case you use it in arrays though to prevent run time error 4.