16.02.2018, 23:09
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:
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
command:
PHP код:
CMD:hnext(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pShopTech] >= 1)
{
SendClientMessageEx(playerid, COLOR_RED, "* Listing next available house...");
for(new x;x<MAX_HOUSES;x++)
{
if(HouseInfo[x][hOwned] == 0)
{
new string[128];
format(string, sizeof(string), "%d is available to use.", x);
SendClientMessageEx(playerid, COLOR_WHITE, string);
break;
}
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use that command.");
return 1;
}
return 1;
}