01.07.2014, 16:33
Try this
pawn Код:
dcmd_house(playerid, params[])
{
#pragma unused params
if (PlayerInfo[playerid][pSpawn] > 0){
new Houseid = PlayerInfo[playerid][pLastOutSideID];
new string[256];
if (GetPlayerVirtualWorld(playerid) > 0 && HouseInfo[Houseid][h_cptype] == CP_TYPE_HOUSE)
{
format(string, sizeof(string), "~p~%s~n~~w~Owner: ~b~%s~n~~w~For Sale ~g~$%d",HouseInfo[Houseid][h_HouseIntName],HouseInfo[Houseid][h_OwnerName],HouseInfo[Houseid][h_Value]);
format(string, sizeof(string), "~p~%s~n~~w~Owner: ~b~%s~n~~w~Property Value ~g~$%d",HouseInfo[Houseid][h_HouseIntName],HouseInfo[Houseid][h_OwnerName],HouseInfo[Houseid][h_Value]);
if (HouseData[Houseid][h_OwnerID] > -1)
{
//If Playerid is Owner
ShowTextDrawMenu(playerid, TD_MENU_HOUSE_OWNER_OPTIONS,"~g~House Owner", 12, 0);
if (HouseData[Houseid][h_ForSale] == 0)format(string, sizeof(string), "~p~%s~n~~w~Owner: ~b~%s~n~~w~For Sale ~g~$%d",HouseInfo[Houseid][h_HouseIntName],HouseData[Houseid][h_OwnerName],HouseData[Houseid][h_Value]);
else format(string, sizeof(string), "~p~%s~n~~w~Owner: ~b~%s",HouseInfo[Houseid][h_HouseIntName],HouseData[Houseid][h_OwnerName]);
format(string, sizeof(string), "~p~%s",HouseInfo[Houseid][h_HouseIntName]);
ShowTextDrawMenuItems(playerid, 0, string, " ", " ",0);
ShowTextDrawMenuItems(playerid, 1, " ", " ", " ",0);
ShowTextDrawMenuItems(playerid, 2, " ", " ", " ",0);
ShowTextDrawMenuItems(playerid, 3, " ", "~y~1 ~w~- Details", " ",0);
ShowTextDrawMenuItems(playerid, 4, " ", "~y~2 ~w~- Storage", " ",0);
ShowTextDrawMenuItems(playerid, 5, " ", "~y~3 ~w~- Set Name", " ",0);
ShowTextDrawMenuItems(playerid, 6, " ", "~y~4 ~w~- Set Price", " ",0);
ShowTextDrawMenuItems(playerid, 7, " ", "~y~5 ~w~- Set Rent", " ",0);
ShowTextDrawMenuItems(playerid, 8, " ", "~y~6 ~w~- Set Lock", " ",0);
ShowTextDrawMenuItems(playerid, 9, " ", "~y~7 ~w~- Set Alarm", " ",0);
ShowTextDrawMenuItems(playerid, 10, " ", "~y~8 ~w~- Sell House", " ",0);
}else{
//If Playerid is not Owner
if (HouseData[Houseid][h_Rent] == 0)
{
ShowTextDrawMenu(playerid, TD_MENU_HOUSE_MAIN_OPTIONS,"~g~House", 8, 2);
if (HouseData[Houseid][h_ForSale] == 0)format(string, sizeof(string), "~p~%s~n~~w~Owner: ~b~%s~n~~w~For Sale ~g~$%d",HouseInfo[Houseid][h_HouseIntName],HouseData[Houseid][h_OwnerName],HouseData[Houseid][h_Value]);
else format(string, sizeof(string), "~p~%s~n~~w~Owner: ~b~%s",HouseInfo[Houseid][h_HouseIntName],HouseData[Houseid][h_OwnerName]);
ShowTextDrawMenuItems(playerid, 0, string, " ", " ",0);
ShowTextDrawMenuItems(playerid, 1, " ", " ", " ",0);
ShowTextDrawMenuItems(playerid, 2, " ", " ", " ",0);
ShowTextDrawMenuItems(playerid, 3, " ", " ", " ",0);
ShowTextDrawMenuItems(playerid, 4, " ", " ", " ",0);
ShowTextDrawMenuItems(playerid, 5, " ", "~y~1 ~w~- House Details", " ",0);
ShowTextDrawMenuItems(playerid, 6, " ", "~y~2 ~w~- House Storage", " ",0);
}else{
ShowTextDrawMenu(playerid, TD_MENU_HOUSE_MAIN_OPTIONS,"~g~House", 8, 2);
format(string, sizeof(string), "~p~%s~n~~w~Owner: ~b~%s~n~~w~For Rent ~g~$%d ~w~/ Day",HouseInfo[Houseid][h_HouseIntName],HouseData[Houseid][h_OwnerName],HouseData[Houseid][h_Rent]);
ShowTextDrawMenuItems(playerid, 0, string, " ", " ",0);
ShowTextDrawMenuItems(playerid, 1, " ", " ", " ",0);
ShowTextDrawMenuItems(playerid, 2, " ", " ", " ",0);
ShowTextDrawMenuItems(playerid, 3, " ", " ", " ",0);
ShowTextDrawMenuItems(playerid, 4, " ", " ", " ",0);
ShowTextDrawMenuItems(playerid, 5, " ", "~y~1 ~w~- House Details", " ",0);
ShowTextDrawMenuItems(playerid, 6, " ", "~y~2 ~w~- House Storage", " ",0);
}
}
}else{
SendClientMessage(playerid, COLOR_ERROR, "You Must Be Inside A House To Use This Command.");
}
}else{
SendClientMessage(playerid, COLOR_ERROR, "You Cannot Use This Command When You're Dead.");
}
return 1;
}