OnPlayerEditDynamicObject.pwn 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. /* The streamer is using a new version of sampGDK which conflicts with YSI's hooks library.
  2. Therefore, all of it is routed to a regular callback until a resolution is found.
  3. */
  4. forward OnPlayerEditGate(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz);
  5. public OnPlayerEditGate(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz) // Gate Editor Fix by Winterfield. DO NOT REMOVE.
  6. {
  7. //printf("%i | %d | %d | %f | %f | %f | %f | %f | %f", playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz); // debug
  8. CallLocalFunction("OnPlayerEditDynamicObject", "iddffffff", playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz);
  9. }
  10. public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ) {
  11. return 0;
  12. }
  13. forward OnPlayerEditDObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz);
  14. public OnPlayerEditDObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz) // Object Editor Fix.
  15. {
  16. //printf("%i | %d | %d | %f | %f | %f | %f | %f | %f", playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz); // debug
  17. CallLocalFunction("OnPlayerEditDynamicObject", "iddffffff", playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz);
  18. }
  19. public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz) {
  20. // Under OnPlayerEditObject
  21. /*
  22. if(GetPVarInt(playerid, "_EditingSafeObjectID") == objectid)
  23. {
  24. new iSafeID = GetPVarInt(playerid, "_EditingSafeID"),
  25. str[128];
  26. if(response == EDIT_RESPONSE_FINAL) {
  27. SafeData[iSafeID][g_fPos][0] = x;
  28. SafeData[iSafeID][g_fPos][1] = y;
  29. SafeData[iSafeID][g_fPos][2] = z;
  30. SafeData[iSafeID][g_fPos][3] = rx;
  31. SafeData[iSafeID][g_fPos][4] = ry;
  32. SafeData[iSafeID][g_fPos][5] = rz;
  33. processSafe(iSafeID);
  34. saveSafe(iSafeID);
  35. format(str, sizeof str, "You have edited the position of Safe ID %i.", iSafeID);
  36. SendClientMessageEx(playerid, COLOR_LIGHTRED, str);
  37. DeletePVar(playerid, "_EditingSafeObjectID");
  38. }
  39. else if(response == EDIT_RESPONSE_CANCEL) {
  40. format(str, sizeof str, "You have quit editing Safe ID %i.", iSafeID);
  41. SendClientMessageEx(playerid, COLOR_LIGHTRED, str);
  42. DeletePVar(playerid, "_EditingSafeID");
  43. }
  44. }
  45. */
  46. if(GetPVarType(playerid, "DeployingTapeID"))
  47. {
  48. new tid = GetPVarInt(playerid, "DeployingTapeID"), valid = 0;
  49. if(response == EDIT_RESPONSE_FINAL || response == EDIT_RESPONSE_CANCEL)
  50. {
  51. DeletePVar(playerid, "DeployingTapeID");
  52. new Float:offsetX, Float:offsetY, Float:offsetZ;
  53. offsetX = x - Tapes[tid][sX];
  54. offsetY = y - Tapes[tid][sY];
  55. offsetZ = z - Tapes[tid][sZ];
  56. if(offsetX <= 10.0 && offsetX >= -10.0)
  57. {
  58. if(offsetY <= 10.0 && offsetY >= -10.0)
  59. {
  60. if(offsetZ <= 10.0 && offsetZ >= -10.0)
  61. {
  62. Tapes[tid][sX] = x;
  63. Tapes[tid][sY] = y;
  64. Tapes[tid][sZ] = z;
  65. if(IsValidDynamicObject(Tapes[tid][sObjectID])) DestroyDynamicObject(Tapes[tid][sObjectID]);
  66. Tapes[tid][sObjectID] = CreateDynamicObject(19834, x, y, z, rx, ry, rz, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
  67. /*
  68. SetDynamicObjectPos(Tapes[tid][sObjectID], x, y, z);
  69. SetDynamicObjectPos(Tapes[tid][sObjectID], rx, ry, rz);
  70. */
  71. format(szMiscArray, sizeof(szMiscArray), "Tape ID: %d's position has been edited successfully.", tid);
  72. SendClientMessage(playerid, COLOR_WHITE, szMiscArray);
  73. valid = 1;
  74. }
  75. else SendClientMessageEx(playerid, COLOR_GRAD2, "Maximum Z Offset exceeded. Please try again.");
  76. }
  77. else SendClientMessageEx(playerid, COLOR_GRAD2, "Maximum Y Offset exceeded. Please try again.");
  78. }
  79. else SendClientMessageEx(playerid, COLOR_GRAD2, "Maximum X Offset exceeded. Please try again.");
  80. if(!valid)
  81. {
  82. DestroyDynamicObject(Tapes[tid][sObjectID]);
  83. Tapes[tid][sX] = 0;
  84. Tapes[tid][sY] = 0;
  85. Tapes[tid][sZ] = 0;
  86. Tapes[tid][sObjectID] = INVALID_OBJECT_ID;
  87. Tapes[tid][sDeployedBy] = INVALID_PLAYER_ID;
  88. Tapes[tid][sDeployedByStatus] = 0;
  89. }
  90. }
  91. }
  92. if(GetPVarType(playerid, PVAR_FURNITURE_EDITING)) {
  93. switch(response) {
  94. case EDIT_RESPONSE_CANCEL: {
  95. new iModelID = Streamer_GetIntData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_MODEL_ID);
  96. GetDynamicObjectPos(objectid, x, y, z);
  97. GetDynamicObjectRot(objectid, rx, ry, rz);
  98. SetDynamicObjectPos(objectid, x, y, z);
  99. SetDynamicObjectRot(objectid, rx, ry, rz);
  100. DeletePVar(playerid, "PX");
  101. DeletePVar(playerid, "PY");
  102. DeletePVar(playerid, "PZ");
  103. DeletePVar(playerid, "furnfirst");
  104. format(szMiscArray, sizeof(szMiscArray), "[Furniture]: You have cancelled placing the %s.", GetFurnitureName(iModelID));
  105. SendClientMessageEx(playerid, COLOR_YELLOW, szMiscArray);
  106. DeletePVar(playerid, PVAR_FURNITURE_EDITING);
  107. DeletePVar(playerid, PVAR_FURNITURE_SLOT);
  108. PlayerTextDrawSetPreviewModel(playerid, Furniture_PTD[playerid][0], PlayerInfo[playerid][pModel]);
  109. PlayerTextDrawSetPreviewRot(playerid, Furniture_PTD[playerid][0], 345.000000, 0.000000, 320.000000, 1.000000);
  110. PlayerTextDrawHide(playerid, Furniture_PTD[playerid][0]);
  111. PlayerTextDrawShow(playerid, Furniture_PTD[playerid][0]);
  112. SelectTextDraw(playerid, 0xF6FBFCFF);
  113. }
  114. case EDIT_RESPONSE_FINAL: {
  115. new iModelID = GetDynamicObjectModel(objectid),
  116. iSlotID = GetPVarInt(playerid, PVAR_FURNITURE_SLOT),
  117. iHouseID = GetHouseID(playerid);
  118. #define MAX_OBJECT_TEXTSLOTS 5
  119. new iTmpModel[MAX_OBJECT_TEXTSLOTS],
  120. szTXDName[MAX_OBJECT_TEXTSLOTS][32],
  121. szTextureName[MAX_OBJECT_TEXTSLOTS][32],
  122. iColor;
  123. for(new iIndex; iIndex < MAX_OBJECT_TEXTSLOTS; ++iIndex) {
  124. GetDynamicObjectMaterial(HouseInfo[iHouseID][hFurniture][iSlotID], iIndex, iTmpModel[iIndex], szTXDName[iIndex], szTextureName[iIndex], iColor, 32, 32);
  125. if(isnull(szTXDName[iIndex])) break;
  126. }
  127. if(IsValidFurniture(iHouseID, iSlotID, 1)) DestroyDynamicObject(HouseInfo[iHouseID][hFurniture][iSlotID]);
  128. HouseInfo[iHouseID][hFurniture][iSlotID] = CreateDynamicObject(iModelID, x, y, z, rx, ry, rz, HouseInfo[iHouseID][hIntVW]);
  129. for(new iIndex; iIndex < MAX_OBJECT_TEXTSLOTS; ++iIndex) {
  130. SetDynamicObjectMaterial(HouseInfo[iHouseID][hFurniture][iSlotID], iIndex, iTmpModel[iIndex], szTXDName[iIndex], szTextureName[iIndex], 0);
  131. if(isnull(szTXDName[iIndex])) break;
  132. }
  133. if(IsADoor(iModelID)) {
  134. new iLocalDoorArea = Streamer_GetIntData(STREAMER_TYPE_OBJECT, HouseInfo[iHouseID][hFurniture][iSlotID], E_STREAMER_EXTRA_ID),
  135. szData[3];
  136. if(IsValidDynamicArea(iLocalDoorArea)) DestroyDynamicArea(iLocalDoorArea);
  137. iLocalDoorArea = CreateDynamicSphere(x, y, z, 1.0, HouseInfo[iHouseID][hIntVW]);
  138. szData[0] = iHouseID;
  139. szData[1] = HouseInfo[iHouseID][hFurniture][iSlotID];
  140. szData[2] = 0;
  141. Streamer_SetArrayData(STREAMER_TYPE_AREA, iLocalDoorArea, E_STREAMER_EXTRA_ID, szData, sizeof(szData)); // Assign Object ID to Area.
  142. }
  143. Streamer_SetIntData(STREAMER_TYPE_OBJECT, HouseInfo[iHouseID][hFurniture][iSlotID], E_STREAMER_EXTRA_ID, iHouseID);
  144. mysql_format(MainPipeline, szMiscArray, sizeof(szMiscArray), "UPDATE `furniture` SET `x` = '%f', `y` = '%f', `z` = '%f', `rx` = '%f', `ry` = '%f', `rz` = '%f' \
  145. WHERE `houseid` = '%d' AND `slotid` = '%d'", x, y, z, rx, ry, rz, iHouseID, iSlotID);
  146. mysql_tquery(MainPipeline, szMiscArray, "OnEditFurniture", "");
  147. foreach(new i : Player) Streamer_Update(i);
  148. PlayerTextDrawSetPreviewModel(playerid, Furniture_PTD[playerid][0], PlayerInfo[playerid][pModel]);
  149. PlayerTextDrawSetPreviewRot(playerid, Furniture_PTD[playerid][0], 345.000000, 0.000000, 320.000000, 1.000000);
  150. PlayerTextDrawHide(playerid, Furniture_PTD[playerid][0]);
  151. PlayerTextDrawShow(playerid, Furniture_PTD[playerid][0]);
  152. format(szMiscArray, sizeof(szMiscArray), "[Furniture]: You have successfully placed the %s.", GetFurnitureName(iModelID));
  153. SendClientMessageEx(playerid, COLOR_YELLOW, szMiscArray);
  154. DeletePVar(playerid, "furnfirst");
  155. DeletePVar(playerid, "PX");
  156. DeletePVar(playerid, "PY");
  157. DeletePVar(playerid, "PZ");
  158. DeletePVar(playerid, PVAR_FURNITURE_EDITING);
  159. DeletePVar(playerid, PVAR_FURNITURE_SLOT);
  160. // printf("%d, %d, %d, %f, %f, %f, %f, %f, %f", playerid, objectid, response, x, y, z, rx, ry, rz);
  161. // SelectTextDraw(playerid, 0xF6FBFCFF);
  162. }
  163. }
  164. }
  165. // Gates
  166. if(response == EDIT_RESPONSE_FINAL)
  167. {
  168. szMiscArray[0] = 0;
  169. if(GetPVarInt(playerid, "gEdit") == 1)
  170. {
  171. if(PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pASM] < 1 && PlayerInfo[playerid][pShopTech] < 1) return SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to perform this action!");
  172. new gateid = GetPVarInt(playerid, "EditingGateID");
  173. GateInfo[gateid][gPosX] = x;
  174. GateInfo[gateid][gPosY] = y;
  175. GateInfo[gateid][gPosZ] = z;
  176. GateInfo[gateid][gRotX] = rx;
  177. GateInfo[gateid][gRotY] = ry;
  178. GateInfo[gateid][gRotZ] = rz;
  179. CreateGate(gateid);
  180. SaveGate(gateid);
  181. format(szMiscArray, sizeof(szMiscArray), "You have finished editing the open position of Gate ID: %d", gateid);
  182. SendClientMessage(playerid, COLOR_WHITE, szMiscArray);
  183. DeletePVar(playerid, "gEdit");
  184. DeletePVar(playerid, "EditingGateID");
  185. }
  186. if(GetPVarInt(playerid, "gEdit") == 2)
  187. {
  188. if(PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pASM] < 1 && PlayerInfo[playerid][pShopTech] < 1) return SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to perform this action!");
  189. new gateid = GetPVarInt(playerid, "EditingGateID");
  190. GateInfo[gateid][gPosXM] = x;
  191. GateInfo[gateid][gPosYM] = y;
  192. GateInfo[gateid][gPosZM] = z;
  193. GateInfo[gateid][gRotXM] = rx;
  194. GateInfo[gateid][gRotYM] = ry;
  195. GateInfo[gateid][gRotZM] = rz;
  196. CreateGate(gateid);
  197. SaveGate(gateid);
  198. format(szMiscArray, sizeof(szMiscArray), "You have finished editing the closed position of Gate ID: %d", gateid);
  199. SendClientMessage(playerid, COLOR_WHITE, szMiscArray);
  200. DeletePVar(playerid, "gEdit");
  201. DeletePVar(playerid, "EditingGateID");
  202. }
  203. }
  204. if(response == EDIT_RESPONSE_CANCEL)
  205. {
  206. if(GetPVarType(playerid, "gEdit") == 1)
  207. {
  208. CreateGate(GetPVarInt(playerid, "EditingGateID"));
  209. DeletePVar(playerid, "gEdit");
  210. DeletePVar(playerid, "EditingGateID");
  211. SendClientMessage(playerid, COLOR_WHITE, "You have stopped yourself from editing the gate.");
  212. }
  213. }
  214. if(GetPVarType(playerid, PVAR_EMETDET))
  215. {
  216. new id = GetPVarInt(playerid, PVAR_EMETDET),
  217. iAssignData[2],
  218. Float:fPos[6];
  219. GetDynamicObjectPos(arrMetalDetector[id][metdet_iObjectID], fPos[0], fPos[1], fPos[2]);
  220. GetDynamicObjectRot(arrMetalDetector[id][metdet_iObjectID], fPos[3], fPos[4], fPos[5]);
  221. iAssignData[0] = Streamer_GetIntData(STREAMER_TYPE_OBJECT, arrMetalDetector[id][metdet_iObjectID], E_STREAMER_WORLD_ID);
  222. iAssignData[1] = Streamer_GetIntData(STREAMER_TYPE_OBJECT, arrMetalDetector[id][metdet_iObjectID], E_STREAMER_INTERIOR_ID);
  223. switch(response)
  224. {
  225. case EDIT_RESPONSE_FINAL:
  226. {
  227. SendClientMessageEx(playerid, COLOR_YELLOW, "You successfully edited the metal detector's position.");
  228. MetDet_Process(id, x, y, z, rx, ry, rz, iAssignData[0], iAssignData[1]);
  229. MetDet_SaveMetDet(id);
  230. }
  231. case EDIT_RESPONSE_CANCEL:
  232. {
  233. SetDynamicObjectPos(arrMetalDetector[id][metdet_iObjectID], fPos[0], fPos[1], fPos[2]);
  234. SetDynamicObjectRot(arrMetalDetector[id][metdet_iObjectID], fPos[3], fPos[4], fPos[5]);
  235. SendClientMessageEx(playerid, COLOR_GRAD1, "You have cancelled setting the metal detector's position.");
  236. }
  237. }
  238. DeletePVar(playerid, PVAR_EMETDET);
  239. }
  240. // Parking Meters
  241. if(EditingMeterID[playerid] != 0)
  242. {
  243. new string[128];
  244. switch(response)
  245. {
  246. case EDIT_RESPONSE_FINAL:
  247. {
  248. if(GetPlayerInterior(playerid) != 0 || GetPlayerVirtualWorld(playerid) != 0)
  249. {
  250. SendClientMessageEx(playerid, COLOR_GREY, "You cannot use this feature inside an interior or virtual world.");
  251. RebuildParkingMeter(EditingMeterID[playerid]);
  252. EditingMeterID[playerid] = 0;
  253. return 1;
  254. }
  255. ParkingMeterInformation[EditingMeterID[playerid]][MeterPosition][0] = x;
  256. ParkingMeterInformation[EditingMeterID[playerid]][MeterPosition][1] = y;
  257. ParkingMeterInformation[EditingMeterID[playerid]][MeterPosition][2] = z;
  258. ParkingMeterInformation[EditingMeterID[playerid]][MeterPosition][3] = rx;
  259. ParkingMeterInformation[EditingMeterID[playerid]][MeterPosition][4] = ry;
  260. ParkingMeterInformation[EditingMeterID[playerid]][MeterPosition][5] = rz;
  261. SaveParkingMeter(EditingMeterID[playerid]);
  262. RebuildParkingMeter(EditingMeterID[playerid]);
  263. format(string, sizeof(string), "You have updated the position of parking meter ID %d.", EditingMeterID[playerid]);
  264. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  265. format(string, sizeof(string), "%s updated the position of parking meter ID %d to %0.3f, %0.3f, %0.3f, %0.3f, %0.3f, %0.3f.", GetPlayerNameEx(playerid), EditingMeterID[playerid], x, y, z, rx, ry, rz);
  266. Log("logs/admin.log", string);
  267. EditingMeterID[playerid] = 0;
  268. return 1;
  269. }
  270. case EDIT_RESPONSE_CANCEL:
  271. {
  272. format(string, sizeof(string), "You have cancelled editing the position of parking meter ID %d.", EditingMeterID[playerid]);
  273. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  274. RebuildParkingMeter(EditingMeterID[playerid]);
  275. EditingMeterID[playerid] = 0;
  276. return 1;
  277. }
  278. }
  279. return 1;
  280. }
  281. new Float:fPos[6];
  282. GetDynamicObjectPos(objectid, fPos[0], fPos[1], fPos[2]);
  283. GetDynamicObjectRot(objectid, fPos[3], fPos[4], fPos[5]);
  284. if(GetPVarType(playerid, PVAR_GANGTAGEDITING))
  285. {
  286. switch(response)
  287. {
  288. case EDIT_RESPONSE_CANCEL:
  289. {
  290. SetDynamicObjectPos(objectid, fPos[0], fPos[1], fPos[2]);
  291. SetDynamicObjectRot(objectid, fPos[3], fPos[4], fPos[5]);
  292. DeletePVar(playerid, PVAR_GANGTAGEDITING);
  293. SendClientMessage(playerid, COLOR_GRAD1, "You cancelled editing the gang tag.");
  294. return 1;
  295. }
  296. case EDIT_RESPONSE_FINAL:
  297. {
  298. new i = GetPVarInt(playerid, PVAR_GANGTAGEDITING);
  299. if(IsValidDynamicObject(arrGangTags[i][gt_iObjectID])) DestroyDynamicObject(arrGangTags[i][gt_iObjectID]);
  300. arrGangTags[i][gt_iObjectID] = CreateDynamicObject(GANGTAGS_OBJECTID, x, y, z, rx, ry, rz);
  301. GangTag_AdmSave(playerid, i);
  302. return 1;
  303. }
  304. }
  305. }
  306. if(GetPVarType(playerid, "editingsign")) {
  307. if(response == EDIT_RESPONSE_FINAL)
  308. {
  309. new string[128];
  310. /*if(GetPVarInt(playerid, "Edit") == 2)
  311. {
  312. if(PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pGangModerator] < 1) return SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to perform this action!");
  313. new gangtag = GetPVarInt(playerid, "gt_ID");
  314. GangTags[gangtag][gt_PosX] = x;
  315. GangTags[gangtag][gt_PosY] = y;
  316. GangTags[gangtag][gt_PosZ] = z;
  317. GangTags[gangtag][gt_PosRX] = rx;
  318. GangTags[gangtag][gt_PosRY] = ry;
  319. GangTags[gangtag][gt_PosRZ] = rz;
  320. CreateGangTag(gangtag);
  321. format(string, sizeof(string), "You have edited the position of gang tag %d!", gangtag);
  322. SendClientMessageEx(playerid, COLOR_WHITE, string);
  323. format(string, sizeof(string), "%s has edited the position of gang tag %d.", GetPlayerNameEx(playerid), gangtag);
  324. Log("Logs/GangTags.log", string);
  325. DeletePVar(playerid, "gt_ID");
  326. DeletePVar(playerid, "gt_Edit");
  327. SaveGangTag(gangtag);
  328. }*/
  329. new h = GetPVarInt(playerid, "house");
  330. if(GetPointDistanceToPoint(HouseInfo[h][hExteriorX], HouseInfo[h][hExteriorY], HouseInfo[h][hExteriorZ], x, y, z) > 10)
  331. return SendClientMessageEx(playerid, COLOR_GREY, "Keep the sign within the checkpoint radius!"), EditDynamicObject(playerid, GetPVarInt(playerid, "signID"));
  332. HouseInfo[h][hSign][0] = x;
  333. HouseInfo[h][hSign][1] = y;
  334. HouseInfo[h][hSign][2] = z;
  335. HouseInfo[h][hSign][3] = rz;
  336. if(GetPVarInt(playerid, "editingsign") == 1)
  337. {
  338. HouseInfo[h][hSignExpire] = gettime()+86400;
  339. PlayerInfo[playerid][mInventory][6] = 0;
  340. if(IsValidDynamicObject(GetPVarInt(playerid, "signID"))) DestroyDynamicObject(GetPVarInt(playerid, "signID"));
  341. SendClientMessageEx(playerid, COLOR_GREY, "You have finished placing your house sale sign!");
  342. format(string, sizeof(string), "[PLACESIGN] %s has placed down their house sale sign at House ID: %d", GetPlayerNameEx(playerid), h);
  343. }
  344. if(GetPVarInt(playerid, "editingsign") == 2)
  345. {
  346. SendClientMessageEx(playerid, COLOR_GREY, "You have finished editing the position of your house sale sign!");
  347. format(string, sizeof(string), "[EDITSIGN] %s has edited the position of their house sale sign at House ID: %d", GetPlayerNameEx(playerid), h);
  348. }
  349. if(GetPVarInt(playerid, "editingsign") == 3)
  350. {
  351. SendClientMessageEx(playerid, COLOR_GREY, "You have finished editing the house sale sign!");
  352. format(string, sizeof(string), "[AEDITSIGN] %s has adjusted the position of the house sale sign placed at House ID: %d", GetPlayerNameEx(playerid), h);
  353. }
  354. Log("logs/house.log", string);
  355. CreateHouseSaleSign(h);
  356. SaveHouse(h);
  357. DeletePVar(playerid, "signID");
  358. DeletePVar(playerid, "house");
  359. DeletePVar(playerid, "editingsign");
  360. ClearCheckpoint(playerid);
  361. }
  362. if(response == EDIT_RESPONSE_CANCEL)
  363. {
  364. /*if(GetPVarInt(playerid, "gt_Edit") == 2)
  365. {
  366. new gangid = GetPVarInt(playerid, "gt_ID");
  367. SetDynamicObjectPos(GangTags[gangid][gt_Object], GangTags[gangid][gt_PosX], GangTags[gangid][gt_PosY], GangTags[gangid][gt_PosZ]);
  368. SetDynamicObjectRot(GangTags[gangid][gt_Object], GangTags[gangid][gt_PosRX], GangTags[gangid][gt_PosRY], GangTags[gangid][gt_PosRZ]);
  369. DeletePVar(playerid, "gt_Edit");
  370. DeletePVar(playerid, "gt_ID");
  371. SendClientMessageEx(playerid, COLOR_GREY, "You have stopped editing this gang tag!");
  372. }*/
  373. if(GetPVarInt(playerid, "editingsign") == 1 && IsValidDynamicObject(GetPVarInt(playerid, "signID"))) DestroyDynamicObject(GetPVarInt(playerid, "signID"));
  374. SendClientMessageEx(playerid, COLOR_GREY, "You have stopped yourself from placing down your House Sale Sign!");
  375. DeletePVar(playerid, "signID");
  376. DeletePVar(playerid, "house");
  377. DeletePVar(playerid, "editingsign");
  378. ClearCheckpoint(playerid);
  379. }
  380. }
  381. return 1;
  382. }