Show all owner house in dialog -
Cerealguy - 27.12.2013
Hi friend, how to show all owner house in dialog style list:
Screen:
i use sqlite and i get all the data with this query
pawn Код:
format(fquery, sizeof(fquery), "SELECT `Title` FROM `HOUSEINFO` WHERE `Owner` = '%s'", PlayerName);
I want to get all the titles of their homes
Example : I have two houses, house 1 title = Hello, and the second title House Hello 2, in /myhouse show
Re: Show all owner house in dialog -
Voxel - 27.12.2013
If I understand correctly it should look like this:
pawn Код:
//for this example I will use a command in zcmd
CMD:myhouse(playerid, params[])
{
new house1 = User[playerid][USER_HOUSE1];//store the data in a variable
new house2 = User[playerid][USER_HOUSE2];//same here
new string[150], stats[150];//we need a string to display the text in
format(string, sizeof string, ""chat" "COL_WHITE"House 1: %s\nHouse 2: %s", house1, house2);//the data stored in the variables will be displayed in the string
format(stats, sizeof stats, "%s", string);
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX,"My house",string,"Ok","");
//change all the variables to the ones you use from User[playerid] etc
//also the dialog id!
return 1;
}
Hope that helped you.
Respuesta: Show all owner house in dialog -
Cerealguy - 27.12.2013
Friend the problem is that the player will not always, two houses, or, you can have up to 7 houses, that's my problem
Re: Show all owner house in dialog -
Jefff - 27.12.2013
pawn Код:
for(new houseID = 0; houseID < MAX_HOUSES; houseID++)
if(!strcmp(Nick_Here,HouseInfo[houseID][HouseOwner]))
{
format(str,sizeof(str),"%s%d. %s\n",str,houseID,HouseInfo[houseID][HouseName]);
}
ShowDialog str
Respuesta: Show all owner house in dialog -
Cerealguy - 27.12.2013
thanks Voxel, and jefff

<3
Respuesta: Show all owner house in dialog -
Cerealguy - 27.12.2013
pawn Код:
CMD:carlist(playerid, params[])
{
new pName[MAX_PLAYER_NAME], str[512];
GetPlayerName(playerid, pName, sizeof(pName));
for(new i = 0; i < created; i++)
if(!strcmp(pName, vInfo[i][vowner], true))
{
format(str, sizeof(str),"%d", vInfo[i][vmodel] );
}
ShowPlayerDialog(playerid, 1123, DIALOG_STYLE_LIST,"{00bbff}Cars list", str, "Select", "Close");
return 1;
}
problem D
Re: Show all owner house in dialog -
fordawinzz - 27.12.2013
pawn Код:
format(str, sizeof(str),"%s%d\n", str, vInfo[i][vmodel] );
Respuesta: Show all owner house in dialog -
Cerealguy - 27.12.2013
friend,
I have a car, you must display the model in this case would be 411, as it is an infernus, it goes 0 :c
if I buy other vehicles if they go well, but the first car goes to 0
Re: Show all owner house in dialog -
Konstantinos - 27.12.2013
pawn Код:
if(!strcmp(pName, vInfo[i][vowner], true))
{
if (!vInfo[i][vmodel]) continue;
format(str, sizeof(str),"%s%d\n", str, vInfo[i][vmodel] );
}
If the model is 0, then it will skip it.
Respuesta: Show all owner house in dialog -
Cerealguy - 27.12.2013
Friend the problem is that the model 0 is the first car, and is a infernus should be 411 and not 0