Advertisement
KennJie

House system Bug

Aug 8th, 2015
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.56 KB | None | 0 0
  1. case CP_TYPE_HOUSE:
  2. {
  3. if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  4. {
  5. SendClientMessage(playerid, COLOR_ERROR, "Houses Are Temporary Disabled Due To Bug Fixing. Sorry For Any Inconvienence This May Have Caused You.");
  6.  
  7. SendClientMessage(playerid, COLOR_SERVER_HELP_MSG, "Type /house Or Press The SUB-MISSION Button For House Options.");
  8. SendClientMessage(playerid, COLOR_SERVER_HELP_MSG, "Type /houserob To Rob This House");
  9. PlayerInfo[playerid][pLastOutSideID] = Houseid;
  10.  
  11. GetPlayerPos(playerid, PlayerInfo[playerid][pLastOutSideX],PlayerInfo[playerid][pLastOutSideY],PlayerInfo[playerid][pLastOutSideZ]);
  12. SetPlayerPosEx(playerid,HouseInfo[Houseid][h_entry_x],HouseInfo[Houseid][h_entry_y],HouseInfo[Houseid][h_entry_z],HouseInfo[Houseid][h_entry_a],HouseInfo[Houseid][h_entry_i],HouseInfo[Houseid][h_entry_w]);
  13.  
  14. if (HouseData[Houseid][h_OwnerID] == playerid)
  15. {
  16.  
  17. PlayerInfo[playerid][pLastOutSideID] = Houseid;
  18. HouseData[Houseid][h_OwnerVisits] ++;
  19. GetPlayerPos(playerid, PlayerInfo[playerid][pLastOutSideX],PlayerInfo[playerid][pLastOutSideY],PlayerInfo[playerid][pLastOutSideZ]);
  20. SetPlayerPosEx(playerid,HouseInfo[Houseid][h_entry_x],HouseInfo[Houseid][h_entry_y],HouseInfo[Houseid][h_entry_z],HouseInfo[Houseid][h_entry_a],HouseInfo[Houseid][h_entry_i],HouseInfo[Houseid][h_entry_w]);
  21. SendClientMessage(playerid, COLOR_SERVER_HELP_MSG, "Type /house For House Info And Options.");
  22.  
  23.  
  24. format(string, sizeof(string), "%s",HouseInfo[Houseid][h_HouseIntName]);
  25. strmid(PlayerInfo[playerid][pInteriorName], string, 0, strlen(string), 256);
  26.  
  27. format(string, sizeof(string), "%s",HouseInfo[Houseid][h_HouseExtName]);
  28. strmid(PlayerInfo[playerid][pExteriorName], string, 0, strlen(string), 256);
  29.  
  30. format(string, sizeof(string), "%s In %s",PlayerInfo[playerid][pInteriorName],PlayerInfo[playerid][pExteriorName]);
  31. strmid(PlayerInfo[playerid][pLocation], string, 0, strlen(string), 256);
  32.  
  33. TextDrawSetString(ZoneName[playerid], string);
  34. }else{
  35.  
  36.  
  37. if (HouseData[Houseid][h_OwnerID] == -1)
  38. {
  39. ShowTextDrawMenu(playerid, TD_MENU_HOUSE,"~g~House", 10, 6);
  40. 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]);
  41. ShowTextDrawMenuItems(playerid, 0, string, " ", " ",0);
  42. ShowTextDrawMenuItems(playerid, 1, " ", " ", " ",0);
  43. ShowTextDrawMenuItems(playerid, 2, " ", " ", " ",0);
  44. ShowTextDrawMenuItems(playerid, 3, " ", " ", " ",0);
  45. ShowTextDrawMenuItems(playerid, 4, " ", " ", " ",0);
  46. ShowTextDrawMenuItems(playerid, 5, " ", "~y~1 ~w~- Enter This House", " " ,0);
  47. ShowTextDrawMenuItems(playerid, 6, " ", "~y~2 ~w~- Knock At The Door", " " ,0);
  48. ShowTextDrawMenuItems(playerid, 7, " ", "~y~3 ~w~- Attempt To Break In", " " ,0);
  49. ShowTextDrawMenuItems(playerid, 8, " ", "~y~4 ~w~- Visit This House", " " ,0);
  50. ShowTextDrawMenuItems(playerid, 9, " ", "~y~5 ~w~- Purchase This House", " " ,0);
  51. ShowTextDrawMenuItems(playerid, 10, " ", "~y~6 ~w~- Rent This House", " " ,0);
  52.  
  53. }else{
  54.  
  55. ShowTextDrawMenu(playerid, TD_MENU_HOUSE,"~g~House", 10, 6);
  56.  
  57. if (HouseData[Houseid][h_Rent] == 0)
  58. {
  59. format(string, sizeof(string), "~p~%s~n~~w~Owner: ~b~%s",HouseInfo[Houseid][h_HouseIntName],HouseData[Houseid][h_OwnerName]);
  60. }else{
  61. 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]);
  62. }
  63.  
  64. ShowTextDrawMenuItems(playerid, 0, string, " ", " ",0);
  65. ShowTextDrawMenuItems(playerid, 1, " ", " ", " ",0);
  66. ShowTextDrawMenuItems(playerid, 2, " ", " ", " ",0);
  67. ShowTextDrawMenuItems(playerid, 3, " ", " ", " ",0);
  68. ShowTextDrawMenuItems(playerid, 4, " ", " ", " ",0);
  69. ShowTextDrawMenuItems(playerid, 5, " ", "~y~1 ~w~- Enter This House", " " ,0);
  70. ShowTextDrawMenuItems(playerid, 6, " ", "~y~2 ~w~- Knock At The Door", " " ,0);
  71. ShowTextDrawMenuItems(playerid, 7, " ", "~y~3 ~w~- Attempt To Break In", " " ,0);
  72. ShowTextDrawMenuItems(playerid, 8, " ", "~y~4 ~w~- Visit This House", " " ,0);
  73. ShowTextDrawMenuItems(playerid, 9, " ", "~y~5 ~w~- Purchase This House", " " ,0);
  74. ShowTextDrawMenuItems(playerid, 10, " ", "~y~6 ~w~- Rent This House", " " ,0);
  75.  
  76. }
  77.  
  78.  
  79.  
  80.  
  81. }
  82. }
  83. }
  84.  
  85.  
  86.  
  87. case CP_TYPE_POLICE:
  88. {
  89. if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  90. {
  91. if (PlayerInfo[playerid][pTeam] == TEAM_LAW || PlayerInfo[playerid][pVigilante] == 1)
  92. {
  93. PlayerInfo[playerid][pLastOutSideID] = Houseid;
  94. GetPlayerPos(playerid, PlayerInfo[playerid][pLastOutSideX],PlayerInfo[playerid][pLastOutSideY],PlayerInfo[playerid][pLastOutSideZ]);
  95. SetPlayerPosEx(playerid,HouseInfo[Houseid][h_entry_x],HouseInfo[Houseid][h_entry_y],HouseInfo[Houseid][h_entry_z],HouseInfo[Houseid][h_entry_a],HouseInfo[Houseid][h_entry_i],HouseInfo[Houseid][h_entry_w]);
  96.  
  97. format(string, sizeof(string), "%s",HouseInfo[Houseid][h_HouseIntName]);
  98. strmid(PlayerInfo[playerid][pInteriorName], string, 0, strlen(string), 256);
  99.  
  100. format(string, sizeof(string), "%s",HouseInfo[Houseid][h_HouseExtName]);
  101. strmid(PlayerInfo[playerid][pExteriorName], string, 0, strlen(string), 256);
  102.  
  103. format(string, sizeof(string), "%s In %s",PlayerInfo[playerid][pInteriorName],PlayerInfo[playerid][pExteriorName]);
  104. strmid(PlayerInfo[playerid][pLocation], string, 0, strlen(string), 256);
  105.  
  106. }else{
  107. SendClientMessage(playerid, COLOR_ERROR, "Civilians Cannot Enter This Location.");
  108. }
  109. }
  110. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement