/hnext bugged
#1

Hey guys, as the title says my /hnext is bugged, or it's not scripted how I want it.
If I place a house, which is not bought yet and do /hnext it still says the same as the previous one.
But when someone buys the house, it goes one further.
Is it possible to make when you place one, /hedit exterior (nexthouseid) to get at /hnext the next one?

here's my current code


Quote:

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;
}

Reply
#2

Try this :
pawn Код:
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;
}
Reply
#3

that is exactly the same
Reply
#4

You're requesting assistance on the Next Generation Gaming script? Listen,

I'll point you in the right direction 'Helping' you by doing so.
Код:
            if(HouseInfo[x][hOwned] == 0)
            {
                new string[128];
                format(string, sizeof(string), "%d is available to use.", x);
                SendClientMessageEx(playerid, COLOR_WHITE, string);
                break;
            }
        }
    }
if(HouseInfo[x][hOwned] == 0) - Go look through the house variables.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)