02.05.2017, 06:47
Hello, I am making a system to get a random business, but I do not know if my code will be efficient.
In this I am looking for a business with certain characteristics so that it fits.
In this I am looking for a business with certain characteristics so that it fits.
PHP код:
FindBusiness(playerid)
{
new i = random(ValidBusiness); // Total business
if(BusinessData[i][bizExists] && BusinessData[i][bizType] >= 1 && BusinessData[i][bizType] <= 4 && GetPlayerVirtualWorld(playerid) == BusinessData[i][bizExteriorVW] && GetPlayerInterior(playerid) == BusinessData[i][bizExterior])
{
if (BusinessData[i][bizDeliver][0] != 0.0 && BusinessData[i][bizDeliver][1] != 0.0 && BusinessData[i][bizDeliver][2] != 0.0)
{
print("found!");
return i;
}
}
print("search again.");
return FindBusiness(playerid);
}