Housing dialog using /houses
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
First of all what's the point of this line? If the system is dynamic, the chances of it to have both same House ID and slot in the array are minimum.
pawn Код:
if(HouseInfo[i][hHouseID] == i)
Also showing the dialog inside the loop will only show for the last house. You need to format the string with the previous text and then show the dialog out of the loop
pawn Код:
for (...)
{
    format(string, sizeof (string), "%s ...", string, ...);
}
ShowPlayerDialog(...);
Without using the if statement, the one line that displays the latest created house shows blank formatted information.

Sounded like it would work.. Tried this:

pawn Код:
CMD:houses(playerid, params[])
{
    new string[500];
    if(!IsPlayerLoggedIn(playerid))
    {
        SendClientMessage(playerid, COLOR_RED, "Error"White": You are restricted from using commands until you log in.");
        return 1;
    }
    if(PlayerInfo[playerid][pAdminLevel] < 1)
    {
        SendClientMessage(playerid, COLOR_RED, "Error"White": You do not have the authority to use this command.");
        return 1;
    }
    if(!AdminDuty[playerid])
    {
        SendClientMessage(playerid, COLOR_RED, "Error"White": You are not on duty as an Administrator (/aduty).");
        return 1;
    }
    for(new i = 1; i < MAX_HOUSES; i++)
    {
        if(HouseInfo[i][hHouseID] == i)
        {
            format(string, sizeof(string), "ID: %d - Address: %s - Owner: %s", HouseInfo[i][hHouseID], HouseInfo[i][hAddress], HouseInfo[i][hOwner]);
        }
    }
    ShowPlayerDialog(playerid, DIALOG_HOUSES, DIALOG_STYLE_LIST, ""Lightblue"House List", string, "", "Cancel");
    return 1;
}
But it is still only showing the one line.
Reply


Messages In This Thread
Housing dialog using /houses - by AphexCCFC - 30.04.2014, 21:06
Re: Housing dialog using /houses - by Konstantinos - 30.04.2014, 21:19
Re: Housing dialog using /houses - by AphexCCFC - 30.04.2014, 21:49
Re: Housing dialog using /houses - by Konstantinos - 30.04.2014, 21:58
Re: Housing dialog using /houses - by AphexCCFC - 30.04.2014, 22:09
Re: Housing dialog using /houses - by AphexCCFC - 30.04.2014, 22:21
Re: Housing dialog using /houses - by Konstantinos - 01.05.2014, 10:59

Forum Jump:


Users browsing this thread: 1 Guest(s)