Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- House_Create(playerid, address[], price, location = 50)
- {
- new
- Float:x,
- Float:y,
- Float:z,
- Float:angle;
- if (GetPlayerPos(playerid, x, y, z) && GetPlayerFacingAngle(playerid, angle))
- {
- for (new i = 0; i != MAX_HOUSES; i ++)
- {
- if (!HouseData[i][houseExists])
- {
- HouseData[i][houseExists] = 1;
- HouseData[i][houseOwner] = 0;
- HouseData[i][housePrice] = price;
- HouseData[i][houseMoney] = 0;
- HouseData[i][houseLocPrice] = location;
- HouseData[i][houseLocNb] = 0;
- HouseData[i][houseLocStatus] = 1;
- format(HouseData[i][houseAddress], 32, address);
- HouseData[i][housePos][0] = x;
- HouseData[i][housePos][1] = y;
- HouseData[i][housePos][2] = z;
- HouseData[i][housePos][3] = angle;
- HouseData[i][houseInt][0] = 2269.8772;
- HouseData[i][houseInt][1] = -1210.3240;
- HouseData[i][houseInt][2] = 1047.5625;
- HouseData[i][houseInt][3] = 90.0000;
- HouseData[i][houseInterior] = 10;
- HouseData[i][houseExterior] = GetPlayerInterior(playerid);
- HouseData[i][houseExteriorVW] = GetPlayerVirtualWorld(playerid);
- HouseData[i][houseLights] = false;
- HouseData[i][houseLocked] = false;
- HouseData[i][houseFaction] = -1;
- House_Refresh(i);
- mysql_function_query(g_iHandle, "INSERT INTO `houses` (`houseOwner`) VALUES(0)", false, "OnHouseCreated", "d", i);
- House_Save(i);
- return i;
- }
- }
- }
- return -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment