21.05.2015, 14:06
i tried checking if the player is in range of point then the value set to the id of business and if not in range of point then it set to 0 and i set the timer for this public repeat each second. but when i get in game and go to the area. it doesnt work. but when i deleted the detect if i am not in the area. the command work. but ofcourse when i get out of the area i can still use the command because the value is not 0 anymore. i just wonder how to detect if i am not in the area correctly
Код:
public InBusinessCheck(playerid)
{
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;
}
for(new i = 0; i < sizeof(Businesses); i++)
if(!IsPlayerInRangeOfPoint(playerid, 3, Businesses[i][bInteriorX], Businesses[i][bInteriorY], Businesses[i][bInteriorZ]))
{
Player[playerid][InBusiness] = 0;
}
return 1;
}

