Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Okay. This house system v1.0 by Micko. In this house system you ca do following:
- if you are admin:
- Create House
- Edit House
- Port to house (soon)
- Sell Anyones House (soon)
- everyone else
- Buy House
- You can put:
- Drugs
- Money
- Weapons
- Skin
- Change Interior
- Upgrade it
- Bell
- Fridge
- Unlock
- Lock
- Allow/Forbidd rent in your house
- I hope this system will help to you guys. This is v1.0 but i might upgrade it :)
- If you find any bugs PM me on: http://forum.sa-mp.com/
- My account: http://forum.sa-mp.com/member.php?u=275247
- If you are going to edit it at lease leave me in credits in comments :)
- */
- #include < a_samp >
- #include < foreach >
- #include < streamer >
- #include < YSI\y_ini >
- #include < sscanf2 >
- #include < zcmd >
- //============================== [ Dialogs ] ===================================//
- #define DIALOG_HOUSE 1
- #define DIALOG_HINFO 2
- #define DIALOG_HPUT 3
- #define DIALOG_HPMONEY 4
- #define DIALOG_HPDRUGS 5
- #define DIALOG_HTAKE 6
- #define DIALOG_HTMONEY 7
- #define DIALOG_HTDRUGS 8
- #define DIALOG_HSELL 9
- #define DIALOG_HRENT 10
- #define DIALOG_HUPGRADE 11
- #define DIALOG_HFOOD 12
- //================================ [ Colors] ===================================//
- #define HGREEN "{04CC29}"
- #define WHITE "{FFFFFF}"
- //============================= [ Player Enum ] ================================//
- //You need this player enum because without it you can't save player's house, rent and drugs :)
- //I was lazy to make saving system for player so make you go and make one ;)
- enum pInfo
- {
- pHouseOwner,
- pRenting,
- pDrugs
- };
- new PlayerInfo[MAX_PLAYERS][pInfo];
- //============================= [ House Enum ] =================================//
- #define HOUSE_FILE "Houses/%d.ini"
- #define MAX_HOUSES 300
- enum Houses
- {
- hIsOwned,
- hOwner[MAX_PLAYER_NAME],
- hType[35],
- Float:hEnterX,
- Float:hEnterY,
- Float:hEnterZ,
- Float:hExitX,
- Float:hExitY,
- Float:hExitZ,
- hLevel,
- hPrice,
- hMoney,
- hInt,
- hLocked,
- hVW,
- hWeapons,
- hAmmo,
- hRent,
- hRentPrice,
- hBell,
- hFridge,
- hDrugs,
- hSkin,
- hIntType,
- hFood
- };
- new HouseInfo[MAX_HOUSES][Houses];
- new HousePickup[sizeof(HouseInfo)];
- new Text3D:HouseLabel[sizeof(HouseInfo)];
- public OnFilterScriptInit()
- {
- for(new h = 0; h < sizeof(HouseInfo); h++)
- {
- new hFile[80], string[500];
- format(hFile, sizeof(hFile), HOUSE_FILE, h);
- if(fexist(hFile))
- {
- INI_ParseFile(hFile, "LoadHouses", .bExtra = true, .extra = h);
- if(HouseInfo[h][hIsOwned] == 0)
- {
- format(string, sizeof(string), ""HGREEN"House on Sale!\nType: "WHITE"%s\n"HGREEN"Price: "WHITE"%d$\n"HGREEN"Level: "WHITE"%d\n"HGREEN"To buy house type /buyhouse",HouseInfo[h][hType], HouseInfo[h][hPrice], HouseInfo[h][hLevel]);
- HouseLabel[h] = Create3DTextLabel(string, 0x33CCFFAA, HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ], 30.0, 0, 1);
- HousePickup[h] = CreateDynamicPickup(1237, 1, HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ]);
- }
- else if(HouseInfo[h][hIsOwned] == 1)
- {
- if(HouseInfo[h][hRent] == 0)
- {
- format(string, sizeof(string), ""HGREEN"Owner: "WHITE"%s\n"HGREEN"Type: "WHITE"%s\n"HGREEN"Level: "WHITE"%d\n"HGREEN"Price: "WHITE"%d$\n", HouseInfo[h][hOwner], HouseInfo[h][hType], HouseInfo[h][hLevel], HouseInfo[h][hPrice]);
- }
- else if(HouseInfo[h][hRent] == 1)
- {
- format(string, sizeof(string), ""HGREEN"Owner: "WHITE"%s\n"HGREEN"Type: "WHITE"%s\n"HGREEN"Level: "WHITE"%d\n"HGREEN"Price: "WHITE"%d$\n"HGREEN"Rent Price: "WHITE"%d$\n"HGREEN"To rent house type /renthouse", HouseInfo[h][hOwner], HouseInfo[h][hType], HouseInfo[h][hLevel], HouseInfo[h][hPrice]);
- }
- HouseLabel[h] = Create3DTextLabel(string, 0x33CCFFAA, HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ], 30.0, 0, 1);
- HousePickup[h] = CreateDynamicPickup(1239, 1, HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ]);
- }
- }
- }
- return 1;
- }
- public OnFilterScriptExit()
- {
- for(new h = 0; h < sizeof(HouseInfo); h++)
- {
- SaveHouse(h);
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_HOUSE)
- {
- if(!response)
- {
- return 1;
- }
- if(response)
- {
- new i = PlayerInfo[playerid][pHouseOwner];
- switch(listitem)
- {
- case 0:
- {
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ]))
- {
- SendClientMessage(playerid, -1, "You are not in your house");
- return 1;
- }
- new string1[275], string2[275], string[550], z[4], o[4], g[4];
- if(HouseInfo[i][hLocked] == 1)
- {
- z = "Yes";
- }
- else
- {
- z = "No";
- }
- if(HouseInfo[i][hSkin] == 1)
- {
- o = "No";
- }
- else
- {
- o = "Yes";
- }
- if(HouseInfo[i][hWeapons] == -1)
- {
- g = "No";
- }
- else
- {
- g = "Yes";
- }
- format(string1, sizeof(string1), ""WHITE"_______________________________________\n\n"HGREEN"Owner: "WHITE"%s\n"HGREEN"Level: "WHITE"%d\n"HGREEN"Price: "WHITE"%d$\n"HGREEN"Rent Price: "WHITE"%d\n", HouseInfo[i][hOwner], HouseInfo[i][hLevel], HouseInfo[i][hPrice], HouseInfo[i][hRentPrice]);
- format(string2, sizeof(string2), ""HGREEN"ID: "WHITE"%d\n"HGREEN"Locked: "WHITE"%s\n"HGREEN"Money: "WHITE"%d\n"HGREEN"Drugs: "WHITE"%d\n"HGREEN"Skin: "WHITE"%s\n"HGREEN"Weapons: "WHITE"%s\n_______________________________________",i, z, HouseInfo[i][hMoney], HouseInfo[i][hDrugs], o, g);
- format(string, sizeof(string), "%s%s", string1, string2);
- ShowPlayerDialog(playerid, DIALOG_HINFO, DIALOG_STYLE_MSGBOX, ""WHITE"House Info", string, "Ok", "Exit");
- }
- case 1:
- {
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ]))
- {
- SendClientMessage(playerid, -1, "You are not in your house");
- return 1;
- }
- if(HouseInfo[i][hLocked] == 0)
- {
- SendClientMessage(playerid, -1, "House is allready unlocked");
- return 1;
- }
- HouseInfo[i][hLocked] = 0;
- SaveHouse(i);
- SendClientMessage(playerid, -1, "House unlocked");
- }
- case 2:
- {
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ]))
- {
- SendClientMessage(playerid, -1, "You are not in your house");
- return 1;
- }
- if(HouseInfo[i][hLocked] == 1)
- {
- SendClientMessage(playerid, -1, "House is allready locked");
- return 1;
- }
- HouseInfo[i][hLocked] = 1;
- SaveHouse(i);
- SendClientMessage(playerid, -1, "House locked");
- }
- case 3:
- {
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ]))
- {
- SendClientMessage(playerid, -1, "You are not in your house");
- return 1;
- }
- ShowPlayerDialog(playerid, DIALOG_HPUT, DIALOG_STYLE_LIST, ""WHITE"Put in house", ""HGREEN"(1). "WHITE"Money\n"HGREEN"(2). "WHITE"Drugs\n"HGREEN"(3). "WHITE"Skin\n"HGREEN"(4). "WHITE"Weapons", "Ok", "Leave");
- }
- case 4:
- {
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ]))
- {
- SendClientMessage(playerid, -1, "You are not in your house");
- return 1;
- }
- ShowPlayerDialog(playerid, DIALOG_HTAKE, DIALOG_STYLE_LIST, ""WHITE"Put in house", ""HGREEN"(1). "WHITE"Money\n"HGREEN"(2). "WHITE"Drugs\n"HGREEN"(3). "WHITE"Skin\n"HGREEN"(4). "WHITE"Weapons", "Ok", "Leave");
- }
- case 5:
- {
- if(PlayerInfo[playerid][pHouseOwner] == -1)
- {
- SendClientMessage(playerid, -1, "You don't have any houses");
- return 1;
- }
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]))
- {
- SendClientMessage(playerid, -1, "You need to be outside of your house");
- return 1;
- }
- new price1 = (HouseInfo[i][hPrice] / 4) * 2;
- new string[256];
- format(string, sizeof(string), ""WHITE"Selling house to the state\n\n"HGREEN"Are you sure you want to sell your house to state for %d$!\n\n"WHITE"If you want to then click on 'Sell' if not click on 'Exit'", price1);
- ShowPlayerDialog(playerid, DIALOG_HSELL, DIALOG_STYLE_MSGBOX, ""WHITE"Selling house to the state", string, "Sell", "Exit");
- }
- case 6:
- {
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ]))
- {
- SendClientMessage(playerid, -1, "You are not in your house");
- return 1;
- }
- if(HouseInfo[i][hRent] == 0)
- {
- HouseInfo[i][hRent] = 1;
- SaveHouse(i);
- HouseLP(i);
- SendClientMessage(playerid, -1, "Your house is now rentable");
- }
- else if(HouseInfo[i][hRent] == 1)
- {
- HouseInfo[i][hRent] = 0;
- SaveHouse(i);
- HouseLP(i);
- SendClientMessage(playerid, -1, "Your house is not rentable anymore");
- }
- }
- case 7:
- {
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ]))
- {
- SendClientMessage(playerid, -1, "You are not in your house");
- return 1;
- }
- if(HouseInfo[i][hRent] == 0)
- {
- SendClientMessage(playerid, -1, "To ajust rent price you need to allo rent to your house");
- return 1;
- }
- ShowPlayerDialog(playerid, DIALOG_HRENT, DIALOG_STYLE_INPUT, ""HGREEN"Rent Price", ""WHITE"Please enter new rent price", "Set", "Leave");
- }
- case 8:
- {
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]))
- {
- SendClientMessage(playerid, -1, "You need to be outside of your house");
- return 1;
- }
- new string5[256];
- format(string5, sizeof(string5), ""HGREEN"(1). "WHITE"Bell (2000$)\n"HGREEN"(2). "WHITE"Fridge (3000$)\n"HGREEN"(3). "WHITE"Standard Interior\n"HGREEN"(4). "WHITE"Interior 2 (30000$)\n"HGREEN"(5). "WHITE"Interior 3 (40000$)");
- ShowPlayerDialog(playerid, DIALOG_HUPGRADE, DIALOG_STYLE_LIST, ""WHITE"House upgrading", string5, "Ok", "Exit");
- }
- case 9:
- {
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ]))
- {
- SendClientMessage(playerid, -1, "You are not in your house");
- return 1;
- }
- if(HouseInfo[i][hFridge] == 0)
- {
- SendClientMessage(playerid, -1, "You don't have fridge");
- return 1;
- }
- ShowPlayerDialog(playerid, DIALOG_HFOOD, DIALOG_STYLE_LIST, ""WHITE"Food", ""HGREEN"(1). "WHITE"Take food\n"HGREEN"(2). "WHITE"Put food in fridge", "Ok", "Exit");
- }
- }
- }
- }
- ////////////////////////////////////////////////////////////////////////////////////
- if(dialogid == DIALOG_HUPGRADE)
- {
- if(!response)
- {
- return 1;
- }
- if(response)
- {
- if(PlayerInfo[playerid][pHouseOwner] == -1)
- {
- SendClientMessage(playerid, -1, "You don't have house");
- return 1;
- }
- new i = PlayerInfo[playerid][pHouseOwner];
- switch(listitem)
- {
- case 0:
- {
- if(HouseInfo[i][hBell] == 1)
- {
- SendClientMessage(playerid, -1, "You allready have a bell");
- return 1;
- }
- if(GetPlayerMoney(playerid) < 2000)
- {
- SendClientMessage(playerid, -1, "You don't have enough money");
- return 1;
- }
- HouseInfo[i][hBell] = 1;
- GivePlayerMoney(playerid, -2000);
- SaveHouse(i);
- SendClientMessage(playerid, -1, "Your house have a bell now");
- }
- case 1:
- {
- if(HouseInfo[i][hFridge] == 1)
- {
- SendClientMessage(playerid, -1, "You allreade have a fridge");
- return 1;
- }
- if(GetPlayerMoney(playerid) < 3000)
- {
- SendClientMessage(playerid, -1, "You don't have enough money");
- return 1;
- }
- HouseInfo[i][hFridge] = 1;
- GivePlayerMoney(playerid, -3000);
- SendClientMessage(playerid, -1, "You have a fridge now");
- }
- case 2:
- {
- if(HouseInfo[i][hIntType] == 1)
- {
- HouseInfo[i][hExitX] = 223.0732;
- HouseInfo[i][hExitY] = 1288.3668;
- HouseInfo[i][hExitZ] = 1082.1406;
- HouseInfo[i][hInt] = 1;
- SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]);
- SaveHouse(i);
- SendClientMessage(playerid,-1, "You changed interior to standard small house interior");
- }
- else if(HouseInfo[i][hIntType] == 2)
- {
- HouseInfo[i][hExitX] = 2365.2822;
- HouseInfo[i][hExitY] = -1134.5186;
- HouseInfo[i][hExitZ] = 1050.8750;
- HouseInfo[i][hInt] = 8;
- SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]);
- SaveHouse(i);
- SendClientMessage(playerid, -1, "You cnaged interior to standard medium house interior");
- }
- else if(HouseInfo[i][hIntType] == 3)
- {
- HouseInfo[i][hExitX] = 2317.8977;
- HouseInfo[i][hExitY] = -1025.7722;
- HouseInfo[i][hExitZ] = 1050.2109;
- HouseInfo[i][hInt] = 9;
- SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]);
- SaveHouse(i);
- SendClientMessage(playerid,-1, "You changed interior to standard big house interior");
- }
- else if(HouseInfo[i][hIntType] == 4)
- {
- HouseInfo[i][hExitX] = 140.2605;
- HouseInfo[i][hExitY] = 1367.4221;
- HouseInfo[i][hExitZ] = 1083.8615;
- HouseInfo[i][hInt] = 5;
- SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]);
- SaveHouse(i);
- SendClientMessage(playerid, -1, "You changed interior to standard villa interior");
- }
- }
- case 3:
- {
- if(GetPlayerMoney(playerid) < 30000)
- {
- SendClientMessage(playerid, -1, "You don't have enough money");
- return 1;
- }
- GivePlayerMoney(playerid, -30000);
- if(HouseInfo[i][hIntType] == 1)
- {
- HouseInfo[i][hExitX] = 2308.7527;
- HouseInfo[i][hExitY] = -1211.7507;
- HouseInfo[i][hExitZ] = 1049.0234;
- HouseInfo[i][hInt] = 6;
- SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]);
- SaveHouse(i);
- SendClientMessage(playerid, -1, "You succesfully changed small house interior");
- }
- else if(HouseInfo[i][hIntType] == 2)
- {
- HouseInfo[i][hExitX] = 2195.9036;
- HouseInfo[i][hExitY] = -1204.4109;
- HouseInfo[i][hExitZ] = 1049.0234;
- HouseInfo[i][hInt] = 6;
- SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]);
- SaveHouse(i);
- SendClientMessage(playerid, -1, "You succesfully changed medium house interior");
- }
- else if(HouseInfo[i][hIntType] == 3)
- {
- HouseInfo[i][hExitX] = 83.1142;
- HouseInfo[i][hExitY] = 1323.1691;
- HouseInfo[i][hExitZ] = 1083.8594;
- HouseInfo[i][hInt] = 9;
- SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]);
- SaveHouse(i);
- SendClientMessage(playerid, -1, "You succesfully changed big house interior");
- }
- else if(HouseInfo[i][hIntType] == 4)
- {
- HouseInfo[i][hExitX] = 226.9117;
- HouseInfo[i][hExitY] = 1114.2726;
- HouseInfo[i][hExitZ] = 1080.9961;
- HouseInfo[i][hInt] = 5;
- SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]);
- SaveHouse(i);
- SendClientMessage(playerid, -1, "You succesfully changed villa interior");
- }
- }
- case 4:
- {
- if(GetPlayerMoney(playerid) < 40000)
- {
- SendClientMessage(playerid,-1, "You don't have enough money");
- return 1;
- }
- GivePlayerMoney(playerid, -40000);
- if(HouseInfo[i][hIntType] == 1)
- {
- HouseInfo[i][hExitX] = 261.0457;
- HouseInfo[i][hExitY] = 1285.4824;
- HouseInfo[i][hExitZ] = 1080.2578;
- HouseInfo[i][hInt] = 4;
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]);
- SaveHouse(i);
- SendClientMessage(playerid,-1, "You succesfully changed small house interior");
- }
- else if(HouseInfo[i][hIntType] == 2)
- {
- HouseInfo[i][hExitX] = 2269.3962;
- HouseInfo[i][hExitY] = -1210.4148;
- HouseInfo[i][hExitZ] = 1047.5625;
- HouseInfo[i][hInt] = 10;
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]);
- SaveHouse(i);
- SendClientMessage(playerid, -1, "You succesfully changed medium house interior");
- }
- else if(HouseInfo[i][hIntType] == 3)
- {
- HouseInfo[i][hExitX] = 2324.4817;
- HouseInfo[i][hExitY] = -1148.3988;
- HouseInfo[i][hExitZ] = 1050.7101;
- HouseInfo[i][hInt] = 12;
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]);
- SaveHouse(i);
- SendClientMessage(playerid, -1, "You succesfully changed big house interior");
- }
- else if(HouseInfo[i][hIntType] == 4)
- {
- HouseInfo[i][hExitX] = 225.9810;
- HouseInfo[i][hExitY] = 1022.8190;
- HouseInfo[i][hExitZ] = 1084.0137;
- HouseInfo[i][hInt] = 7;
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]);
- SaveHouse(i);
- SendClientMessage(playerid, -1, "You succesfully changed villa interior");
- }
- }
- }
- }
- }
- ////////////////////////////////////////////////////////////////////////////////////
- if(dialogid == DIALOG_HRENT)
- {
- if(!response)
- {
- return 1;
- }
- if(response)
- {
- new i = PlayerInfo[playerid][pHouseOwner];
- new price1 = (HouseInfo[i][hPrice] / 4) * 2;
- GivePlayerMoney(playerid, price1);
- HouseInfo[i][hIsOwned] = 0;
- HouseInfo[i][hMoney] = 0;
- HouseInfo[i][hWeapons] = -1;
- HouseInfo[i][hAmmo] = 0;
- HouseInfo[i][hSkin] = 0;
- HouseInfo[i][hDrugs] = 0;
- HouseInfo[i][hLocked] = 1;
- HouseInfo[i][hRent] = 0;
- HouseInfo[i][hFood] = 0;
- strmid(HouseInfo[i][hOwner], "Niko", 0, strlen("Niko"), 255);
- PlayerInfo[playerid][pHouseOwner] = -1;
- SaveHouse(i);
- HouseLP(i);
- new string[40];
- format(string, sizeof(string), "You sold your house for %d$", price1);
- }
- }
- ////////////////////////////////////////////////////////////////////////////////////
- if(dialogid == DIALOG_HTAKE)
- {
- if(!response)
- {
- return 1;
- }
- if(response)
- {
- new i = PlayerInfo[playerid][pHouseOwner];
- switch(listitem)
- {
- case 0:
- {
- ShowPlayerDialog(playerid, DIALOG_HTMONEY, DIALOG_STYLE_INPUT, ""HGREEN"Take money", ""WHITE"Please put in money that you want to take from your home", "Take", "Exit");
- }
- case 1:
- {
- ShowPlayerDialog(playerid, DIALOG_HTDRUGS, DIALOG_STYLE_INPUT, ""HGREEN"Take drugs", ""WHITE"Please put in drugs that you want to take from your home", "Take", "Exit");
- }
- case 2:
- {
- if(HouseInfo[i][hSkin] == 0)
- {
- SendClientMessage(playerid, -1, "You don't have any skin in your house");
- return 1;
- }
- SetPlayerSkin(playerid, HouseInfo[i][hSkin]);
- HouseInfo[i][hSkin] = 0;
- SendClientMessage(playerid, -1, "You took skin from your house");
- SaveHouse(i);
- }
- case 3:
- {
- if(HouseInfo[i][hWeapons] == -1)
- {
- SendClientMessage(playerid, -1, "You don't have any weapons in your house");
- return 1;
- }
- GivePlayerWeapon(playerid, HouseInfo[i][hWeapons], HouseInfo[i][hAmmo]);
- HouseInfo[i][hWeapons] = -1;
- HouseInfo[i][hAmmo] = -1;
- SaveHouse(i);
- SendClientMessage(playerid, -1, "You took weapons from your house");
- }
- }
- }
- }
- if(dialogid == DIALOG_HTDRUGS)
- {
- if(!response)
- {
- return 1;
- }
- if(response)
- {
- new i = PlayerInfo[playerid][pHouseOwner];
- new drugs;
- if(sscanf(inputtext, "i", drugs))
- {
- ShowPlayerDialog(playerid, DIALOG_HTDRUGS, DIALOG_STYLE_INPUT, ""HGREEN"Take drugs", ""WHITE"Please put in drugs that you want to take from your home", "Take", "Exit");
- return 1;
- }
- if(drugs > HouseInfo[i][hDrugs])
- {
- SendClientMessage(playerid, -1, "You don't have that much drug in your house");
- return 1;
- }
- if(drugs < 1 || drugs > 50000)
- {
- SendClientMessage(playerid, -1, "You can't take less than 1 or more that 50000");
- return 1;
- }
- HouseInfo[i][hDrugs] -= drugs;
- PlayerInfo[playerid][pDrugs] += drugs;
- SaveHouse(i);
- new string1[55];
- format(string1, sizeof(string1), "You took %dg drugs", drugs);
- SendClientMessage(playerid, -1, string1);
- }
- }
- if(dialogid == DIALOG_HTMONEY)
- {
- if(!response)
- {
- return 1;
- }
- if(response)
- {
- new i = PlayerInfo[playerid][pHouseOwner];
- new money;
- if(sscanf(inputtext, "i", money))
- {
- ShowPlayerDialog(playerid, DIALOG_HTMONEY, DIALOG_STYLE_INPUT, ""HGREEN"Take money", ""WHITE"Please put in money that you want to take from your home", "Take", "Exit");
- return 1;
- }
- if(money > HouseInfo[i][hMoney])
- {
- SendClientMessage(playerid, -1, "You don;t have that much money in your house");
- return 1;
- }
- HouseInfo[i][hMoney] -= money;
- GivePlayerMoney(playerid, money);
- SaveHouse(i);
- new string[55];
- format(string, sizeof(string), "You took %d$ from house", money);
- SendClientMessage(playerid, -1, string);
- }
- }
- if(dialogid == DIALOG_HPUT)
- {
- if(!response)
- {
- return 1;
- }
- if(response)
- {
- new i = PlayerInfo[playerid][pHouseOwner];
- switch(listitem)
- {
- case 0:
- {
- ShowPlayerDialog(playerid, DIALOG_HPMONEY, DIALOG_STYLE_INPUT, ""HGREEN"Put money", ""WHITE"Put in how much money you want to leave in your house", "Put", "Exit");
- }
- case 1:
- {
- ShowPlayerDialog(playerid, DIALOG_HPDRUGS, DIALOG_STYLE_INPUT, ""HGREEN"Put drugs", ""WHITE"Put in how much drugs you want to leave in your house", "Put", "Exit");
- }
- case 2:
- {
- if(HouseInfo[i][hSkin] != 0)
- {
- SendClientMessage(playerid, -1, "You allreade have skin in your house");
- return 1;
- }
- HouseInfo[i][hSkin] = GetPlayerSkin(playerid);
- SaveHouse(i);
- SendClientMessage(playerid, -1, "You've put your skin in house");
- }
- case 4:
- {
- if(HouseInfo[i][hWeapons] != -1)
- {
- SendClientMessage(playerid, -1, "You allready have weapons in your house");
- return 1;
- }
- if(GetPlayerWeapon(playerid) <= 0)
- {
- SendClientMessage(playerid, -1, "You don't have any weapons in your hand");
- return 1;
- }
- HouseInfo[i][hWeapons] = GetPlayerWeapon(playerid);
- HouseInfo[i][hAmmo] = GetPlayerAmmo(playerid);
- SaveHouse(i);
- SendClientMessage(playerid, -1, "You've put your weapons in house");
- }
- }
- }
- }
- if(dialogid == DIALOG_HPDRUGS)
- {
- if(!response)
- {
- return 1;
- }
- if(response)
- {
- new i = PlayerInfo[playerid][pHouseOwner];
- new drugs;
- if(sscanf(inputtext, "i", drugs))
- {
- ShowPlayerDialog(playerid, DIALOG_HPDRUGS, DIALOG_STYLE_INPUT, ""HGREEN"Put drugs", ""WHITE"Put in how much drugs you want to leave in your house", "Put", "Exit");
- return 1;
- }
- if(drugs > PlayerInfo[playerid][pDrugs])
- {
- SendClientMessage(playerid, -1, "You don't have that much drugs");
- return 1;
- }
- HouseInfo[i][hDrugs] += drugs;
- PlayerInfo[playerid][pDrugs] -= drugs;
- SaveHouse(i);
- new string[55];
- format(string, sizeof(string), "You've put %dg drugs in house", drugs);
- SendClientMessage(playerid, -1, string);
- }
- }
- if(dialogid == DIALOG_HPMONEY)
- {
- if(!response)
- {
- return 1;
- }
- if(response)
- {
- new i = PlayerInfo[playerid][pHouseOwner];
- new money;
- if(sscanf(inputtext, "i", money))
- {
- ShowPlayerDialog(playerid, DIALOG_HPMONEY, DIALOG_STYLE_INPUT, ""HGREEN"Put money", ""WHITE"Put in how much money you want to leave in your house", "Put", "Exit");
- return 1;
- }
- if(money > GetPlayerMoney(playerid))
- {
- SendClientMessage(playerid, -1, "You don't have that much money");
- return 1;
- }
- HouseInfo[i][hMoney] += money;
- GivePlayerMoney(playerid, -money);
- SaveHouse(i);
- new string[55];
- format(string, sizeof(string), "You've put %d$ in your house", money);
- SendClientMessage(playerid, -1, string);
- }
- }
- return 1;
- }
- CMD:createhouse(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid))
- {
- SendClientMessage(playerid, -1, "You are not allowed to use this command");
- return 1;
- }
- new idhouse, type, level, price, hFile[80], string[500], Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- if(sscanf(params, "iiii", idhouse, type, level, price))
- {
- SendClientMessage(playerid, -1, "/createhouse [ID] [Type] [Level] [Price]");
- SendClientMessage(playerid, -1, "Types: 0: Small | 1: Medium | 2: Big | 3: Villa");
- }
- if(idhouse >= MAX_HOUSES)
- {
- SendClientMessage(playerid, -1, "You've allready reched max houses limit");
- return 1;
- }
- format(hFile, sizeof(hFile), HOUSE_FILE, idhouse);
- if(fexist(hFile))
- {
- SendClientMessage(playerid, -1, "That house ID is allready occupied");
- return 1;
- }
- if(type == 0) // SMALL
- {
- HouseInfo[idhouse][hExitX] = 223.0732;
- HouseInfo[idhouse][hExitY] = 1288.3668;
- HouseInfo[idhouse][hExitZ] = 1082.1406;
- HouseInfo[idhouse][hInt] = 1;
- strmid(HouseInfo[idhouse][hType],"Mala Kuca",0,strlen("Mala Kuca"),255);
- HouseInfo[idhouse][hIntType] = 1;
- }
- else if(type == 1) // MEDIUM
- {
- HouseInfo[idhouse][hExitX] = 2365.2822;
- HouseInfo[idhouse][hExitY] = -1134.5186;
- HouseInfo[idhouse][hExitZ] = 1050.8750;
- HouseInfo[idhouse][hInt] = 8;
- strmid(HouseInfo[idhouse][hType],"Srednja Kuca",0,strlen("Srednja Kuca"),255);
- HouseInfo[idhouse][hIntType] = 2;
- }
- else if(type == 2) // BIG
- {
- HouseInfo[idhouse][hExitX] = 2317.8977;
- HouseInfo[idhouse][hExitY] = -1025.7722;
- HouseInfo[idhouse][hExitZ] = 1050.2109;
- HouseInfo[idhouse][hInt] = 9;
- strmid(HouseInfo[idhouse][hType],"Velika Kuca",0,strlen("Velika Kuca"),255);
- HouseInfo[idhouse][hIntType] = 3;
- }
- else if(type == 3) // VILLA
- {
- HouseInfo[idhouse][hExitX] = 140.2605;
- HouseInfo[idhouse][hExitY] = 1367.4221;
- HouseInfo[idhouse][hExitZ] = 1083.8615;
- HouseInfo[idhouse][hInt] = 5;
- strmid(HouseInfo[idhouse][hType],"Villa",0,strlen("Villa"),255);
- HouseInfo[idhouse][hIntType] = 4;
- }
- HouseInfo[idhouse][hPrice] = price;
- HouseInfo[idhouse][hLevel] = level;
- HouseInfo[idhouse][hEnterX] = X;
- HouseInfo[idhouse][hEnterY] = Y;
- HouseInfo[idhouse][hEnterZ] = Z;
- HouseInfo[idhouse][hFood] = 0;
- HouseInfo[idhouse][hIsOwned] = 0;
- HouseInfo[idhouse][hFridge] = 0;
- HouseInfo[idhouse][hMoney] = 0;
- HouseInfo[idhouse][hLocked] = 1;
- HouseInfo[idhouse][hVW] = idhouse;
- HouseInfo[idhouse][hBell] = 0;
- HouseInfo[idhouse][hWeapons] = -1;
- HouseInfo[idhouse][hAmmo] = 0;
- HouseInfo[idhouse][hRent] = 0;
- HouseInfo[idhouse][hRentPrice] = 50;
- HouseInfo[idhouse][hDrugs] = 0;
- HouseInfo[idhouse][hSkin] = 0;
- strmid(HouseInfo[idhouse][hOwner], "Noone", 0, strlen("Noone"), 255);
- format(string, sizeof(string), ""HGREEN"House on Sale!\nType: "WHITE"%s\n"HGREEN"Price: "WHITE"%d$\n"HGREEN"Level: "WHITE"%d\n"HGREEN"To buy house type /buyhouse",HouseInfo[idhouse][hType], HouseInfo[idhouse][hPrice], HouseInfo[idhouse][hLevel]);
- HouseLabel[idhouse] = Create3DTextLabel(string, 0x33CCFFAA, X, Y, Z, 25, 0, 1);
- HousePickup[idhouse] = CreateDynamicPickup(1273, 1, HouseInfo[idhouse][hEnterX], HouseInfo[idhouse][hEnterY], HouseInfo[idhouse][hEnterZ]);
- SaveHouse(idhouse);
- format(string, sizeof(string), "You succesfully created house (ID: %d)", idhouse);
- return 1;
- }
- CMD:buyhouse(playerid, params[])
- {
- for(new h; h < sizeof(HouseInfo); h++)
- {
- if(!strcmp(HouseInfo[h][hOwner], "Noone", true) && HouseInfo[h][hIsOwned] == 0)
- {
- if(PlayerInfo[playerid][pHouseOwner] != -1)
- {
- SendClientMessage(playerid, -1, "You can't buy house. You allready have one");
- return 1;
- }
- if(GetPlayerScore(playerid) < HouseInfo[h][hLevel])
- {
- SendClientMessage(playerid, -1, "You are not big enough level to buy this house");
- return 1;
- }
- if(GetPlayerMoney(playerid) < HouseInfo[h][hPrice])
- {
- SendClientMessage(playerid, -1, "You don't have enough money");
- return 1;
- }
- if(PlayerInfo[playerid][pRenting] != 1)
- {
- SendClientMessage(playerid, -1, "You need to unrent current house");
- return 1;
- }
- strmid(HouseInfo[h][hOwner], GetName(playerid), 0, strlen(GetName(playerid)), 255);
- HouseInfo[h][hIsOwned] = 1;
- SetPlayerInterior(playerid, HouseInfo[h][hInt]);
- PlayerInfo[playerid][pHouseOwner] = h;
- SetPlayerVirtualWorld(playerid, HouseInfo[h][hVW]);
- SetPlayerPos(playerid, HouseInfo[h][hExitX], HouseInfo[h][hExitY], HouseInfo[h][hExitZ]);
- HouseInfo[h][hLocked] = 1;
- GivePlayerMoney(playerid, -HouseInfo[h][hPrice]);
- HouseLP(h);
- SaveHouse(h);
- SendClientMessage(playerid, -1, "You purchased house. Type /house for more info");
- return 1;
- }
- else
- {
- SendClientMessage(playerid, -1, "That house is not for sale");
- return 1;
- }
- }
- return 1;
- }
- CMD:house(playerid, params[])
- {
- new string1[275], string2[275], string[550];
- if(PlayerInfo[playerid][pHouseOwner] == -1)
- {
- SendClientMessage(playerid, -1, "You are homeless");
- return 1;
- }
- if(strcmp(HouseInfo[PlayerInfo[playerid][pHouseOwner]][hOwner], GetName(playerid), true))
- {
- SendClientMessage(playerid, -1, "You are not owner of that house");
- return 1;
- }
- format(string1, sizeof(string1), ""HGREEN"(1). "WHITE"Info\n"HGREEN"(2). "WHITE"Unlock\n"HGREEN"(3). "WHITE"Lock\n"HGREEN"(4). "WHITE"Put in house\n"HGREEN"(5). "WHITE"Take from house\n");
- format(string2, sizeof(string1), ""HGREEN"(6). "WHITE"Sell house\n"HGREEN"(7). "WHITE"Allow/Forbid rent\n"HGREEN"(8). "WHITE"Rent Price\n"HGREEN"(9). "WHITE"Upgrade - Change");//\n"HGREEN"(10). "WHITE"Take from fridge"); // this one will be upgraded in future versions. Let it be like this for now :)
- format(string, sizeof(string), "%s%s", string1, string2);
- ShowPlayerDialog(playerid, DIALOG_HOUSE, DIALOG_STYLE_LIST, ""HGREEN"House", string, "Choose", "Leave");
- return 1;
- }
- CMD:renthouse(playerid, params[])
- {
- for(new h = 0; h < MAX_HOUSES; h++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 3.0, HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ]))
- {
- if(PlayerInfo[playerid][pHouseOwner] != 1)
- {
- SendClientMessage(playerid, -1, "You can't rent because you owning a house");
- return 1;
- }
- if(HouseInfo[h][hRent] == 0)
- {
- SendClientMessage(playerid, -1, "You can't rent this house");
- return 1;
- }
- if(GetPlayerMoney(playerid) < HouseInfo[h][hRentPrice])
- {
- SendClientMessage(playerid, -1, "You don't have enough money");
- return 1;
- }
- new string[50];
- GivePlayerMoney(playerid, -HouseInfo[h][hRentPrice]);
- HouseInfo[h][hMoney] += HouseInfo[h][hRentPrice];
- PlayerInfo[playerid][pRenting] = h;
- SetPlayerInterior(playerid, HouseInfo[h][hInt]);
- SetPlayerVirtualWorld(playerid, HouseInfo[h][hVW]);
- SetPlayerPos(playerid, HouseInfo[h][hExitX], HouseInfo[h][hExitY], HouseInfo[h][hExitZ]);
- format(string, sizeof(string), "You rented a house for %d$", HouseInfo[h][hRentPrice]);
- return 1;
- }
- }
- return 1;
- }
- CMD:ring(playerid, params[])
- {
- for(new h = 0; h < sizeof(HouseInfo); h++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 3.0, HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ]))
- {
- if(HouseInfo[h][hBell] == 0)
- {
- SendClientMessage(playerid, -1, "That house does not have bell");
- return 1;
- }
- SendClientMessage(playerid, -1, "You are ringing");
- foreach(Player, i)
- {
- if(IsPlayerInRangeOfPoint(i, 30.0, HouseInfo[h][hExitX], HouseInfo[h][hExitY], HouseInfo[h][hExitZ]))
- {
- SendClientMessage(playerid, i, "Someone is ringing on your doors");
- }
- }
- }
- }
- return 1;
- }
- CMD:unrenthouse(playerid, params[])
- {
- if(PlayerInfo[playerid][pHouseOwner] != 1)
- {
- SendClientMessage(playerid, -1, "You can't do that. You are a house owner");
- return 1;
- }
- if(PlayerInfo[playerid][pRenting] == -1)
- {
- SendClientMessage(playerid, -1, "You are not renting any house");
- return 1;
- }
- PlayerInfo[playerid][pRenting] = -1;
- SendClientMessage(playerid, -1, "You unrented the house. You are homeless now");
- return 1;
- }
- CMD:ehouse(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid))
- {
- SendClientMessage(playerid, -1, "You are not authorised to use this command");
- return 1;
- }
- new what[35], string[100], quantity; //i think i spelled this right xD
- if(sscanf(params, "s[35]i", what, quantity)) //this also
- {
- SendClientMessage(playerid, -1, "/ehouse [level, price, money] [quantity]"); // this too :D
- return 1;
- }
- for(new h; h < MAX_HOUSES; h++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 3.0, HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ]))
- {
- if(!strcmp(what, "level", true))
- {
- HouseInfo[h][hLevel] = quantity; //what is happening with me??
- HouseLP(h);
- SaveHouse(h);
- format(string, sizeof(string), "You changed house's level (ID: %d) to %d!", h, HouseInfo[h][hLevel]);
- SendClientMessage(playerid, -1, string);
- }
- else if(!strcmp(what, "price", true))
- {
- HouseInfo[h][hPrice] = quantity; // WHOOOAAA this is very strange!!
- HouseLP(h);
- SaveHouse(h);
- format(string, sizeof(string), "You changed house's price (ID: %d) to %d!", h, HouseInfo[h][hPrice]);
- SendClientMessage(playerid, -1, string);
- }
- else if(!strcmp(what, "novac", true))
- {
- HouseInfo[h][hMoney] = quantity; //Okay this is to much for me to handle. I am out
- HouseLP(h); //Just kidding im back
- SaveHouse(h);
- format(string, sizeof(string), "You changed house's money (ID: %d) to %d!", h, HouseInfo[h][hMoney]);
- }
- }
- }
- return 1;
- }
- //===================== [ This is for loading houses ] =========================//
- forward LoadHouses(idhouse, name[], value[]);
- public LoadHouses(idhouse, name[], value[])
- {
- INI_Int("IsOwned", HouseInfo[idhouse][hIsOwned]);
- INI_String("Owner", HouseInfo[idhouse][hOwner],45);
- INI_String("Type", HouseInfo[idhouse][hType],35);
- INI_Float("EnterX", HouseInfo[idhouse][hEnterX]);
- INI_Float("EnterY", HouseInfo[idhouse][hEnterY]);
- INI_Float("EnterZ", HouseInfo[idhouse][hEnterZ]);
- INI_Float("ExitX", HouseInfo[idhouse][hExitX]);
- INI_Float("ExitY", HouseInfo[idhouse][hExitY]);
- INI_Float("ExitZ", HouseInfo[idhouse][hExitZ]);
- INI_Int("Level", HouseInfo[idhouse][hLevel]);
- INI_Int("Price", HouseInfo[idhouse][hPrice]);
- INI_Int("Money", HouseInfo[idhouse][hMoney]);
- INI_Int("Interior", HouseInfo[idhouse][hInt]);
- INI_Int("Locked", HouseInfo[idhouse][hLocked]);
- INI_Int("VW", HouseInfo[idhouse][hVW]);
- INI_Int("Weapons", HouseInfo[idhouse][hWeapons]);
- INI_Int("Ammo", HouseInfo[idhouse][hAmmo]);
- INI_Int("Rent", HouseInfo[idhouse][hRent]);
- INI_Int("RentPrice", HouseInfo[idhouse][hRentPrice]);
- INI_Int("Bell", HouseInfo[idhouse][hBell]);
- INI_Int("Fridge", HouseInfo[idhouse][hFridge]);
- INI_Int("Drugs", HouseInfo[idhouse][hDrugs]);
- INI_Int("Skins", HouseInfo[idhouse][hSkin]);
- INI_Int("IntType", HouseInfo[idhouse][hIntType]);
- INI_Int("Food", HouseInfo[idhouse][hFood]);
- return 1;
- }
- //===================== [ This is for saving houses ] ==========================// //when i say saving i don't mean about saving it from fire. Don't worry it won't get burned :D Or is it?? o.O
- stock SaveHouse(idhouse)
- {
- new hFile[128];
- format(hFile, sizeof(hFile), HOUSE_FILE, idhouse);
- new INI:File = INI_Open(hFile);
- INI_WriteInt(File, "Is Owned", HouseInfo[idhouse][hIsOwned]);
- INI_WriteString(File, "Owner", HouseInfo[idhouse][hOwner]);
- INI_WriteString(File, "Type", HouseInfo[idhouse][hType]);
- INI_WriteFloat(File, "EnterX", HouseInfo[idhouse][hEnterX]);
- INI_WriteFloat(File, "EnterY", HouseInfo[idhouse][hEnterY]);
- INI_WriteFloat(File, "EnterZ", HouseInfo[idhouse][hEnterZ]);
- INI_WriteFloat(File, "ExitX", HouseInfo[idhouse][hExitX]);
- INI_WriteFloat(File, "ExitY", HouseInfo[idhouse][hExitY]);
- INI_WriteFloat(File, "ExitZ", HouseInfo[idhouse][hExitZ]);
- INI_WriteInt(File, "Level", HouseInfo[idhouse][hLevel]);
- INI_WriteInt(File, "Price", HouseInfo[idhouse][hPrice]); //price of house
- INI_WriteInt(File, "Money", HouseInfo[idhouse][hMoney]); //money that is saved in house
- INI_WriteInt(File, "Interior", HouseInfo[idhouse][hInt]);
- INI_WriteInt(File, "Locked", HouseInfo[idhouse][hLocked]);
- INI_WriteInt(File, "VW", HouseInfo[idhouse][hVW]);
- INI_WriteInt(File, "Weapons", HouseInfo[idhouse][hWeapons]);
- INI_WriteInt(File, "Ammo", HouseInfo[idhouse][hAmmo]);
- INI_WriteInt(File, "Rent", HouseInfo[idhouse][hRent]); //is rent allowed
- INI_WriteInt(File, "RentPrice", HouseInfo[idhouse][hRentPrice]); // price of rent
- INI_WriteInt(File, "Bell", HouseInfo[idhouse][hBell]);
- INI_WriteInt(File, "Fridge", HouseInfo[idhouse][hFridge]);
- INI_WriteInt(File, "Drugs", HouseInfo[idhouse][hDrugs]);
- INI_WriteInt(File, "Skin", HouseInfo[idhouse][hSkin]);
- INI_WriteInt(File, "IntType", HouseInfo[idhouse][hIntType]);
- INI_WriteInt(File, "Food", HouseInfo[idhouse][hFood]);
- INI_Close(File);
- return 1;
- }
- stock HouseLP(h)
- {
- new string[500];
- if(HouseInfo[h][hIsOwned] == 0)
- {
- Delete3DTextLabel(HouseLabel[h]);
- DestroyDynamicPickup(HousePickup[h]);
- format(string, sizeof(string), ""HGREEN"House on Sale!\nType: "WHITE"%s\n"HGREEN"Price: "WHITE"%d$\n"HGREEN"Level: "WHITE"%d\n"HGREEN"To buy house type /buyhouse",HouseInfo[h][hType], HouseInfo[h][hPrice], HouseInfo[h][hLevel]);
- HouseLabel[h] = Create3DTextLabel(string, 0x33CCFFAA, HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ], 30.0, 0, 1);
- HousePickup[h] = CreateDynamicPickup(1237, 1, HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ]);
- }
- else if(HouseInfo[h][hIsOwned] == 1)
- {
- Delete3DTextLabel(HouseLabel[h]);
- DestroyDynamicPickup(HousePickup[h]);
- if(HouseInfo[h][hRent] == 0)
- {
- format(string, sizeof(string), ""HGREEN"Owner: "WHITE"%s\n"HGREEN"Type: "WHITE"%s\n"HGREEN"Level: "WHITE"%d\n"HGREEN"Price: "WHITE"%d$\n", HouseInfo[h][hOwner], HouseInfo[h][hType], HouseInfo[h][hLevel], HouseInfo[h][hPrice]);
- }
- else if(HouseInfo[h][hRent] == 1)
- {
- format(string, sizeof(string), ""HGREEN"Owner: "WHITE"%s\n"HGREEN"Type: "WHITE"%s\n"HGREEN"Level: "WHITE"%d\n"HGREEN"Price: "WHITE"%d$\n"HGREEN"Rent Price: "WHITE"%d$\n"HGREEN"To rent house type /renthouse", HouseInfo[h][hOwner], HouseInfo[h][hType], HouseInfo[h][hLevel], HouseInfo[h][hPrice]);
- }
- HouseLabel[h] = Create3DTextLabel(string, 0x33CCFFAA, HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ], 30.0, 0, 1);
- HousePickup[h] = CreateDynamicPickup(1239, 1, HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ]);
- }
- return 1;
- }
- stock GetName(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- return name;
- }
Add Comment
Please, Sign In to add comment