Guest User

Untitled

a guest
Oct 1st, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. House_Create(playerid, address[], price, location = 50)
  2. {
  3. new
  4. Float:x,
  5. Float:y,
  6. Float:z,
  7. Float:angle;
  8.  
  9. if (GetPlayerPos(playerid, x, y, z) && GetPlayerFacingAngle(playerid, angle))
  10. {
  11. for (new i = 0; i != MAX_HOUSES; i ++)
  12. {
  13. if (!HouseData[i][houseExists])
  14. {
  15. HouseData[i][houseExists] = 1;
  16. HouseData[i][houseOwner] = 0;
  17. HouseData[i][housePrice] = price;
  18. HouseData[i][houseMoney] = 0;
  19. HouseData[i][houseLocPrice] = location;
  20. HouseData[i][houseLocNb] = 0;
  21. HouseData[i][houseLocStatus] = 1;
  22.  
  23. format(HouseData[i][houseAddress], 32, address);
  24.  
  25. HouseData[i][housePos][0] = x;
  26. HouseData[i][housePos][1] = y;
  27. HouseData[i][housePos][2] = z;
  28. HouseData[i][housePos][3] = angle;
  29.  
  30. HouseData[i][houseInt][0] = 2269.8772;
  31. HouseData[i][houseInt][1] = -1210.3240;
  32. HouseData[i][houseInt][2] = 1047.5625;
  33. HouseData[i][houseInt][3] = 90.0000;
  34.  
  35. HouseData[i][houseInterior] = 10;
  36. HouseData[i][houseExterior] = GetPlayerInterior(playerid);
  37. HouseData[i][houseExteriorVW] = GetPlayerVirtualWorld(playerid);
  38.  
  39. HouseData[i][houseLights] = false;
  40. HouseData[i][houseLocked] = false;
  41.  
  42. HouseData[i][houseFaction] = -1;
  43.  
  44. House_Refresh(i);
  45. mysql_function_query(g_iHandle, "INSERT INTO `houses` (`houseOwner`) VALUES(0)", false, "OnHouseCreated", "d", i);
  46. House_Save(i);
  47. return i;
  48. }
  49. }
  50. }
  51. return -1;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment