IsPlayerInRangeOfPoint
#2

PHP код:
public InBusinessCheck(playerid)
{
    
Player[playerid][InBusiness] = -1;
    
    for(new 
0sizeof(Businesses); i++)
    {
        if(
IsPlayerInRangeOfPoint(playerid3Businesses[i][bInteriorX], Businesses[i][bInteriorY], Businesses[i][bInteriorZ]))
        {
            
Player[playerid][InBusiness] = i;
            break;
        }
    }
    return 
1;

You set it to 0 at first and if the player is in range, it sets the new value and stops the loop otherwise (not in range of any business) it will remain 0.

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.
Reply


Messages In This Thread
IsPlayerInRangeOfPoint - by EaglesBill - 21.05.2015, 14:06
Re: IsPlayerInRangeOfPoint - by Konstantinos - 21.05.2015, 14:10
Re: IsPlayerInRangeOfPoint - by EaglesBill - 21.05.2015, 14:35
Re: IsPlayerInRangeOfPoint - by Konstantinos - 21.05.2015, 14:58
Re: IsPlayerInRangeOfPoint - by EaglesBill - 21.05.2015, 15:33

Forum Jump:


Users browsing this thread: 2 Guest(s)