02.07.2013, 20:33
@Jue Yeh :P I try do it but I wanted to keep this the way it was 
@Shadowdog Here it is
If theres anything else needed; i will get it too
Thanks for trying 
OpenHouseDialog stock.
DIALOG_MY_HOUSE in OnDialogResponse.
Thanks again

@Shadowdog Here it is



OpenHouseDialog stock.
pawn Code:
stock OpenHouseDialog(playerid, houseid)
{
if(!strcmp(HouseInfo[houseid][Owner], INVALID_OWNER, true)) // the house is for sale
{
new string[128];
if(GetPlayerMoney(playerid) >= HouseInfo[houseid][Price]) format(string, 128, "{33AA33}Buy this house for %d$\n{33AA33}Visit this house", HouseInfo[houseid][Price]);
else format(string, 128, "{FF0000}Buy this house for %d$\n{33AA33}Visit this house", HouseInfo[houseid][Price]);
ShowPlayerDialog(playerid, DIALOG_FORSALE_HOUSE, DIALOG_STYLE_LIST, "{33AA33}House for sale!", string, "OK", "Close");
return 1;
}
else // not for sale
{
new string[128];
new string2[128];
new name[24];
GetPlayerName(playerid, name, 24);
if(!strcmp(name, HouseInfo[houseid][Owner], true)) // The player is the owner
{
ShowPlayerDialog(playerid, DIALOG_MY_HOUSE, DIALOG_STYLE_LIST, "{33AA33}Owned House - Owner: you", "{33AA33}Enter your house\n{33AA33}Open/Close the door\n{33AA33}Sell your house", "OK", "Close");
return 0;
}
else // The player is not the owner
{
format(string, 128, "{33AA33}Owned House - Owner: %s", HouseInfo[houseid][Owner]);
if(HouseInfo[houseid][Locked] == 0) format(string2, 128, "{33AA33}Enter this house");
else format(string2, 128, "{FF0000}Enter this house");
ShowPlayerDialog(playerid, DIALOG_OTHERS_HOUSE, DIALOG_STYLE_LIST, string, string2, "OK", "Close");
return -1;
}
}
}
pawn Code:
case DIALOG_MY_HOUSE:
{
if(!response) return 1;
switch(listitem)
{
case 0: // entra
{
EnterHouse(playerid, hID);
}
case 1: // apri/chiudi
{
LockUnlockHouse(playerid, hID);
}
case 2: // vendi
{
new string[64];
format(string, 64, "{33AA33}Do you want to sell your house for %d$?\n{FF0000}All the money, the weapons and the furniture in your storage will remain there, and the next owner can use them.", floatround(HouseInfo[hID][Price]*SELL_MULTIPLIER));
ShowPlayerDialog(playerid, DIALOG_SELL_HOUSE, DIALOG_STYLE_MSGBOX, "{FF8000}CONFIRMATION", string, "Sell", "Don't sell");
}
}
return 1;
}
