house position error
#3

You need to break the loop with "break;" in order to stop looking for houses once you find it. Try this code.

PHP Code:
for(new 1<= 105i++) {
    if(
IsPlayerInRangeOfPoint(playerid5.0HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))    {
        
HouseInfo[i][hType] = type;
        
mysql_format(SQL,str,sizeof(str), "UPDATE houses SET `Type`='%d' WHERE `ID`='%d'",type,HouseInfo[i][hID]);
        
mysql_tquery(SQL,str,"","");
        break;
    } else {
        
SendClientMessage(playeridCOLOR_LIGHTRED"You aren't in range of any house");
        return 
1;
    }

Reply


Messages In This Thread
house position error - by bosmania - 05.04.2019, 14:30
Re: house position error - by JesterlJoker - 05.04.2019, 15:44
Re: house position error - by Markski - 06.04.2019, 05:11

Forum Jump:


Users browsing this thread: 1 Guest(s)