Hnext command doesn't work correctly
#1

I want the /hnext command to see the next house that is available to place but the problem is the house needs to be owned in order to see the next house in /hnext but I want it so it will be shown when the house is placed

command:

PHP код:
CMD:hnext(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= || PlayerInfo[playerid][pShopTech] >= 1)
    {
        
SendClientMessageEx(playeridCOLOR_RED"* Listing next available house...");
        for(new 
x;x<MAX_HOUSES;x++)
        {
            if(
HouseInfo[x][hOwned] == 0)
            {
                new 
string[128];
                
format(stringsizeof(string), "%d is available to use."x);
                
SendClientMessageEx(playeridCOLOR_WHITEstring);
                break;
            }
        }
    }
    else
    {
        
SendClientMessageEx(playeridCOLOR_GRAD2"You are not authorized to use that command.");
        return 
1;
    }
    return 
1;

I tried to change if(HouseInfo[x][hOwned] == 0) to if(HouseInfo[x][hOwned] == 1) but then it shows house ID 0 is available to place but ID 0 is not a valid house as it skipped in the mysql
Reply


Messages In This Thread
Hnext command doesn't work correctly - by IndependentGaming - 16.02.2018, 23:09
Re: Hnext command doesn't work correctly - by Mugala - 17.02.2018, 00:49
Re: Hnext command doesn't work correctly - by Dayrion - 17.02.2018, 01:08

Forum Jump:


Users browsing this thread: 2 Guest(s)