18.09.2011, 17:44
pawn Код:
CMD:house(playerid, params[])
{
for(new i = 0;i < sizeof(HouseInfo);i++)
{
if(IsPlayerInRangeOfPoint(playerid,2,HouseInfo[i][hExitX],HouseInfo[i][hExitX],HouseInfo[i][hExitX]))
{
if(HouseInfo[i][hOwned] == 0 && PlayerInfo[playerid][pHouse] == 0 && HouseInfo[i][hRentable] == 0)
{
ShowPlayerDialog(playerid, 28, DIALOG_STYLE_LIST, "House Information", "Buy House\r\n", "Select", "Close");
}
else if(HouseInfo[i][hOwned] == 0 && PlayerInfo[playerid][pHouse] == 0 && HouseInfo[i][hRentable] == 1)
{
ShowPlayerDialog(playerid, 31, DIALOG_STYLE_LIST, "House Information", "Buy House\r\nRent House\r\n", "Select", "Close");
}
else if(HouseInfo[i][hOwned] == 1)
{
if(!strcmp(HouseInfo[i][hOwner],GetPlayerNameEx(playerid)))
{
ShowPlayerDialog(playerid, 29, DIALOG_STYLE_LIST, "House Information", "Sell House\r\nSet Rent\r\nLock House\r\nUnlock House\r\nHouse Balance\r\n", "Select", "Close");
}
else
{
if(HouseInfo[i][hRentable] == 1)
{
ShowPlayerDialog(playerid, 30, DIALOG_STYLE_LIST, "House Information", "Rent House\r\n", "Select", "Close");
}
}
}
}
}
return 1;
}