Advertisement
_DarkLight_

Attached Object Creator

Jan 10th, 2016
973
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.97 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #define DIAL_BNADM 1
  4. #define DIAL_TONOBIL 2
  5. #define COLOR_YELLOW 0xFFFF00AA
  6. #define COLOR_BLUE 0x0000BBAA
  7. #define COLOR_WHITE 0xFFFFFFAA
  8. #define COLOR_LIGHTBLUE 0x33CCFFAA
  9. #define COLOR_INDIGO 0x4B00B0AA
  10. #define COLOR_DARKYELLOW 0xE5E52BAA
  11. #define COLOR_BASIC 0x0066FFAA
  12. #define yellow 0xFFFF00AA
  13. #define green 0x33FF33AA
  14. #define GREENGT 0xC3FFF6
  15. #define red 0xFF0000AA
  16. #define white 0xFFFFFFAA
  17. #define pink 0xCCFF00FF
  18. #define blue 0x00FFFFAA
  19. #define blue1 0x00FFFFAA
  20. #define grey 0xC0C0C0AA
  21. #define orange 0xFF9900AA
  22. #define black 0x2C2727AA
  23. #define lightblue 0x33CCFFAA
  24. #define NICE_PINK 0xEC13C0FF
  25. #define COLOR_GREEN1 0x33AA33AA
  26. #define COLOR_FADE1 0xE6E6E6E6
  27. #define COLOR_FADE2 0xC8C8C8C8
  28. #define COLOR_FADE3 0xAAAAAAAA
  29. #define COLOR_FADE4 0x8C8C8C8C
  30. #define COLOR_FADE5 0x6E6E6E6E
  31. #define COP_MSG 0x660066AA
  32. #define COLOR_ERROR 0xD2691EAA
  33. #define COLOR_DODGERBLUE 0x1E90FFAA
  34. #define COLOR_ROYALBLUE 0x4169FFAA
  35. #define COLOR_FORESTGREEN 0x228B22AA
  36. #define MESSAGE_COLOR 0xEEEEEEFF
  37. #define ACTION_COLOR 0xEE66EEFF
  38. #define ADMINFS_MESSAGE_COLOR 0xFF444499
  39. #define PM_INCOMING_COLOR 0xFFFF22AA
  40. #define PM_OUTGOING_COLOR 0xFFCC2299
  41. #define COLOR_Silver 0xCACACAAA
  42. #define COLOR_RED 0xAA3333AA
  43. #define LIGHTBLUE 0x00FFAAFF
  44. #define ORANGE 0xFF9900AA
  45. #define BLACK 0x000000AA
  46. #define COLOR_RED 0xAA3333AA
  47. #define PSPEED 15
  48. #define FSPEED 0.005
  49. #define FNONE 0
  50. #define FPX 1
  51. #define FPY 2
  52. #define FPZ 3
  53. #define FRX 4
  54. #define FRY 5
  55. #define FRZ 6
  56. #define FSX 7
  57. #define FSY 8
  58. #define FSZ 9
  59. #define D_BP 500
  60. #define D_CO 501
  61. #define D_DAO 502
  62. #define D_UNDO 503
  63. #define D_VCO 504
  64. #define S3B1 format(ddata, sizeof ddata, "Author : Dark_Light \n www.fb.com/SN.SwagBoy");
  65. #define S3B0 format(data, sizeof data, "AOC.pwn");
  66. #define S3B3 fwrite(ffhandler, ddata),fclose(ffhandler);
  67. #define S3B4 format(batata, sizeof batata, "Type~<~Left Right~>~"),GameTextForPlayer(playerid,batata,3000,3);
  68. #define S3B5 format(batata, sizeof batata, "Type~<~Left Right~>~ Up & Down"),GameTextForPlayer(playerid,batata,3000,3);
  69. //////ThE NeWs/////////////////////////
  70. new bodyp;
  71. new batata[300];
  72. new obid;
  73. new vobid;
  74. /////////////////
  75. new
  76. Float:POSITION_X,
  77. Float:POSITION_Y,
  78. Float:POSITION_Z,
  79. Float:ROTATION_X,
  80. Float:ROTATION_Y,
  81. Float:ROTATION_Z,
  82. Float:VPOSITION_X,
  83. Float:VPOSITION_Y,
  84. Float:VPOSITION_Z,
  85. Float:VROTATION_X,
  86. Float:VROTATION_Y,
  87. Float:VROTATION_Z;
  88. //////////////////
  89. new Float:SCALE_X=1.0;
  90. new Float:SCALE_Y=1.0;
  91. new Float:SCALE_Z=1.0;
  92. new Float:FANGEL;
  93. new fmode = FNONE;
  94. new trmatimer;
  95. new slfc;
  96. new slno;
  97. new errors;
  98. new verrors;
  99. new anabadi;
  100. new fmsao;
  101. new ttrmatimer;
  102. //////////
  103. new Text:tdaoc;
  104. new Text:tdvoc;
  105. /////////////////////////////////////
  106. public OnFilterScriptInit()
  107. {
  108. new data[256], ddata[300];
  109. S3B0
  110. new File:fhandler = fopen(data, io_write);
  111. format(data, sizeof data, "#include <a_samp>\n#include zcmd\n"),fwrite(fhandler, data),fclose(fhandler),format(ddata, sizeof ddata, "spaoc.txt");
  112. new File:ffhandler = fopen(ddata, io_write);
  113. S3B1
  114. print("\n-------- Attached Object Creator V1 ------");
  115. print("Change XYZ Offsets : /px - /py - /pz");
  116. print("Change XYZ Rotations: /rx - /ry - /rz");
  117. print("Change XYZ Scale : /sx - /sy - /sz");
  118. print("Keys : Up-Down-Right-Left");
  119. print("====================CMDS=======================");
  120. print("-----------------For Player-------------------");
  121. print(" /spaoc /aedit /aend /dao");
  122. print("-----------------For Vehicle-------------------");
  123. print(" /svaoc /vedit /vend ");
  124. print("--------------------------------------------");
  125. print("By : Dark_Light");
  126. S3B3
  127. //////////////////
  128. ////////////////
  129. tdaoc = TextDrawCreate(323,408, "");
  130. TextDrawAlignment(tdaoc, 2);
  131. TextDrawBackgroundColor(tdaoc, BLACK);
  132. TextDrawFont(tdaoc, 3);
  133. TextDrawLetterSize(tdaoc, 0.500000, 1.300000);
  134. TextDrawColor(tdaoc, LIGHTBLUE);
  135. TextDrawSetOutline(tdaoc, 1);
  136. TextDrawSetProportional(tdaoc, 1);
  137. TextDrawBoxColor(tdaoc, 0x00FFAAFF);
  138. TextDrawTextSize(tdaoc, 20.000000, 188.000000);
  139. ////////////////
  140. tdvoc = TextDrawCreate(323,418, "");
  141. TextDrawAlignment(tdvoc, 2);
  142. TextDrawBackgroundColor(tdvoc, BLACK);
  143. TextDrawFont(tdvoc, 3);
  144. TextDrawLetterSize(tdvoc, 0.500000, 1.300000);
  145. TextDrawColor(tdvoc, 0xFF9900AA);
  146. TextDrawSetOutline(tdvoc, 1);
  147. TextDrawSetProportional(tdvoc, 1);
  148. TextDrawBoxColor(tdvoc, 0x33AA33AA);
  149. TextDrawTextSize(tdvoc, 20.000000, 188.000000);
  150. //////////////////
  151. return 1;
  152. }
  153. public OnPlayerDisconnect(playerid, reason)
  154. {
  155. KillTimer(trmatimer);
  156. return 1;
  157. }
  158. forward AOCUP(playerid);
  159. public AOCUP(playerid)
  160. {
  161. new string2[600];
  162. anabadi = DIAL_BNADM;
  163. format(string2, sizeof(string2), "px:%f,py:%f,pz:%f rx:%f,ry:%f,rz:%f sx:%f,sy:%f,sz:%f", POSITION_X,POSITION_Y,POSITION_Z, ROTATION_X, ROTATION_Y, ROTATION_Z, SCALE_X, SCALE_Y, SCALE_Z);
  164. TextDrawSetString(Text:tdaoc,string2);
  165. TextDrawShowForPlayer(playerid,tdaoc);
  166. new KEYS, UD, LR; GetPlayerKeys( playerid, KEYS, UD, LR );
  167. SetPlayerAttachedObject(playerid, slno, obid, bodyp, POSITION_X, POSITION_Y, POSITION_Z, ROTATION_X, ROTATION_Y, ROTATION_Z, SCALE_X, SCALE_Y, SCALE_Z);
  168. if(LR > 0) { cmd_nf(playerid,""); }
  169. else if(LR < 0) { cmd_zf(playerid,""); }
  170. if(UD == KEY_UP) { cmd_nfa(playerid,""); }
  171. else if(UD == KEY_DOWN) { cmd_zfa(playerid,""); }
  172. return true;
  173. }
  174. forward AOCUV(playerid);
  175. public AOCUV(playerid)
  176. {
  177. if(!IsPlayerInAnyVehicle(playerid)) return cmd_vend(playerid,"");
  178. new string2[600];
  179. anabadi = DIAL_TONOBIL;
  180. format(string2, sizeof(string2), "px:%f,py:%f,pz:%f rx:%f,ry:%f,rz:%f", VPOSITION_X,VPOSITION_Y,VPOSITION_Z, VROTATION_X, VROTATION_Y, VROTATION_Z);
  181. TextDrawSetString(Text:tdvoc,string2);
  182. TextDrawShowForPlayer(playerid,tdvoc);
  183. new KEYS, UD, LR; GetPlayerKeys( playerid, KEYS, UD, LR );
  184. if(LR > 0) { cmd_vnf(playerid,""); }
  185. else if(LR < 0) { cmd_vzf(playerid,""); }
  186. return true;
  187. }
  188. CMD:aocmd(playerid,params[])
  189. {
  190. SendClientMessage(playerid,LIGHTBLUE,"\n-------- Attached Object Creator V1 ------");
  191. SendClientMessage(playerid,LIGHTBLUE,"Change XYZ Offsets : /px - /py - /pz");
  192. SendClientMessage(playerid,LIGHTBLUE,"Change XYZ Rotations: /rx - /ry - /rz");
  193. SendClientMessage(playerid,LIGHTBLUE,"Change XYZ Scale : /sx - /sy - /sz");
  194. SendClientMessage(playerid,LIGHTBLUE,"Keys : Up-Down-Right-Left");
  195. SendClientMessage(playerid,LIGHTBLUE,"====================CMDS=======================");
  196. SendClientMessage(playerid,LIGHTBLUE,"-----------------For Player-------------------");
  197. SendClientMessage(playerid,LIGHTBLUE," /spaoc /aedit /aend /dao");
  198. SendClientMessage(playerid,LIGHTBLUE,"-----------------For Vehicle-------------------");
  199. SendClientMessage(playerid,LIGHTBLUE," /svaoc /vedit /vend ");
  200. SendClientMessage(playerid,LIGHTBLUE,"--------------------------------------------");
  201. SendClientMessage(playerid,LIGHTBLUE,"By : Dark_Light");
  202. return 1;
  203. }
  204. CMD:spaoc(playerid,params[])
  205. {
  206. if(anabadi == DIAL_TONOBIL) return SendClientMessage(playerid,COLOR_RED,"ERROR: You Cant Open Two AOC type /vend");
  207. cmd_multico(playerid,"");
  208. if(obid > 0)
  209. {
  210. if(fmsao == 0) {cmd_aexport(playerid,"");}
  211. TogglePlayerControllable(playerid,true);
  212. KillTimer(trmatimer);
  213. ShowPlayerDialog(playerid,D_BP, DIALOG_STYLE_LIST, "Choose Bone"," Spine \n Head \n Left Upper Arm \n Right Upper Arm \n Left Hand \n Right Hand \n Left Thigh \n Right Thigh \n Left Foot \n Right Foot \n Right Calf \n Left Calf \n Left Forearm \n Right Forearm \n Left Clavicle \n Right Clavicle \n Neck \n Jaw","Ok","Cancel");
  214. errors =2;
  215. }else {
  216. ShowPlayerDialog(playerid,D_BP, DIALOG_STYLE_LIST, "Choose Bone"," Spine \n Head \n Left Upper Arm \n Right Upper Arm \n Left Hand \n Right Hand \n Left Thigh \n Right Thigh \n Left Foot \n Right Foot \n Right Calf \n Left Calf \n Left Forearm \n Right Forearm \n Left Clavicle \n Right Clavicle \n Neck \n Jaw","Ok","Cancel");
  217. errors =2;
  218. }
  219. return 1;
  220. }
  221. CMD:svaoc(playerid,params[])
  222. {
  223. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "ERROR: You need to be in a vehicle to use this command.");
  224. if(anabadi == DIAL_BNADM) return SendClientMessage(playerid,COLOR_RED,"ERROR: You Cant Open Two AOC type /aend ");
  225. cmd_multico(playerid,"");
  226. if(vobid > 0)
  227. {
  228. if(fmsao == 0) {cmd_vexport(playerid,"");}
  229. KillTimer(ttrmatimer);
  230. ShowPlayerDialog(playerid,D_VCO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  231. verrors =2;
  232. }else {
  233. ShowPlayerDialog(playerid,D_VCO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  234. verrors =2;
  235. }
  236. return 1;
  237. }
  238. CMD:multico(playerid,params[])
  239. {
  240. new rcolor = random(9);
  241. switch (rcolor)
  242. {
  243. case 0: TextDrawColor(tdaoc, COLOR_YELLOW);
  244. case 1: TextDrawColor(tdaoc, COLOR_BLUE);
  245. case 2: TextDrawColor(tdaoc, COLOR_WHITE);
  246. case 3: TextDrawColor(tdaoc, COLOR_LIGHTBLUE);
  247. case 4: TextDrawColor(tdaoc, COLOR_INDIGO);
  248. case 5: TextDrawColor(tdaoc, COLOR_DARKYELLOW);
  249. case 6: TextDrawColor(tdaoc, COLOR_BASIC);
  250. case 7: TextDrawColor(tdaoc, yellow);
  251. case 8: TextDrawColor(tdaoc, green);
  252. case 9: TextDrawColor(tdaoc, GREENGT);
  253. }
  254. new rcolor2 = random(9);
  255. switch (rcolor2)
  256. {
  257. case 0: TextDrawColor(tdvoc, COLOR_YELLOW);
  258. case 1: TextDrawColor(tdvoc, COLOR_BLUE);
  259. case 2: TextDrawColor(tdvoc, COLOR_WHITE);
  260. case 3: TextDrawColor(tdvoc, COLOR_LIGHTBLUE);
  261. case 4: TextDrawColor(tdvoc, COLOR_INDIGO);
  262. case 5: TextDrawColor(tdvoc, COLOR_DARKYELLOW);
  263. case 6: TextDrawColor(tdvoc, COLOR_BASIC);
  264. case 7: TextDrawColor(tdvoc, yellow);
  265. case 8: TextDrawColor(tdvoc, green);
  266. case 9: TextDrawColor(tdvoc, GREENGT);
  267. }
  268. return 1;
  269. }
  270. CMD:aedit(playerid,params[])
  271. {
  272. if(obid == 0) return SendClientMessage(playerid,COLOR_RED,"ERROR: No AO to edit type /spaoc");
  273. if(errors == 3) return SendClientMessage(playerid,COLOR_RED,"ERROR: You Must end Your Edit!");
  274. TogglePlayerControllable(playerid,false);
  275. errors =3;
  276. KillTimer(trmatimer);
  277. trmatimer = SetTimerEx("AOCUP", PSPEED, true, "d", playerid);
  278. SetPlayerAttachedObject(playerid, slno, obid, bodyp, POSITION_X, POSITION_Y, POSITION_Z, ROTATION_X, ROTATION_Y, ROTATION_Z, SCALE_X, SCALE_Y, SCALE_Z);
  279. return 1;
  280. }
  281. CMD:vedit(playerid,params[])
  282. {
  283. if(vobid == 0) return SendClientMessage(playerid,COLOR_RED,"ERROR: No AO to edit");
  284. if(verrors == 3) return SendClientMessage(playerid,COLOR_RED,"ERROR: You Must end Your Edit!");
  285. verrors =3;
  286. KillTimer(ttrmatimer);
  287. ttrmatimer = SetTimerEx("AOCUV", PSPEED, true, "d", playerid);
  288. return 1;
  289. }
  290. CMD:aend(playerid,params[])
  291. {
  292. anabadi = 0;
  293. if(errors == 3)
  294. {
  295. TogglePlayerControllable(playerid,true);
  296. KillTimer(trmatimer);
  297. errors =0;
  298. fmsao = 1;
  299. cmd_aexport(playerid,"");
  300. TextDrawHideForPlayer(playerid, tdaoc);
  301. TextDrawHideForPlayer(playerid, tdvoc);
  302. }else{
  303. SendClientMessage(playerid,COLOR_RED,"ERROR: No AO to end type /spaoc");}
  304. return 1;
  305. }
  306. CMD:vend(playerid,params[])
  307. {
  308. anabadi = 0;
  309. if(verrors == 3)
  310. {
  311. KillTimer(ttrmatimer);
  312. verrors =0;
  313. fmsao = 1;
  314. cmd_vexport(playerid,"");
  315. TextDrawHideForPlayer(playerid, tdaoc);
  316. TextDrawHideForPlayer(playerid, tdvoc);
  317. }else{
  318. SendClientMessage(playerid,COLOR_RED,"ERROR: No AO to end type /svaoc");}
  319. return 1;
  320. }
  321. CMD:zfa(playerid,params[])
  322. {
  323. GetPlayerFacingAngle(playerid, FANGEL);
  324. SetPlayerFacingAngle(playerid, FANGEL+5);
  325. return 1;
  326. }
  327. CMD:tee(playerid,params[])
  328. {
  329. ttrmatimer = SetTimerEx("VOCUP", PSPEED, true, "d", playerid);
  330. return 1;
  331. }
  332. CMD:teee(playerid,params[])
  333. {
  334. KillTimer(ttrmatimer);
  335. return 1;
  336. }
  337. CMD:nfa(playerid,params[])
  338. {
  339. GetPlayerFacingAngle(playerid, FANGEL);
  340. SetPlayerFacingAngle(playerid, FANGEL-5);
  341. return 1;
  342. }
  343. CMD:zf(playerid,params[])
  344. {
  345. if(fmode == FPX)
  346. {
  347. SetPlayerAttachedObject(playerid, slno, obid, bodyp, POSITION_X, POSITION_Y, POSITION_Z, ROTATION_X, ROTATION_Y, ROTATION_Z, SCALE_X, SCALE_Y, SCALE_Z);
  348. POSITION_X += FSPEED;
  349. }
  350. if(fmode == FPY)
  351. {
  352. POSITION_Y += FSPEED;
  353. SetPlayerAttachedObject(playerid, slno, obid, bodyp, POSITION_X, POSITION_Y, POSITION_Z, ROTATION_X, ROTATION_Y, ROTATION_Z, SCALE_X, SCALE_Y, SCALE_Z);
  354. }
  355. if(fmode == FPZ)
  356. {
  357. POSITION_Z += FSPEED;
  358. SetPlayerAttachedObject(playerid, slno, obid, bodyp, POSITION_X, POSITION_Y, POSITION_Z, ROTATION_X, ROTATION_Y, ROTATION_Z, SCALE_X, SCALE_Y, SCALE_Z);
  359. }
  360. if(fmode == FRX)
  361. {
  362. ROTATION_X += FSPEED*100;
  363. SetPlayerAttachedObject(playerid, slno, obid, bodyp, POSITION_X, POSITION_Y, POSITION_Z, ROTATION_X, ROTATION_Y, ROTATION_Z, SCALE_X, SCALE_Y, SCALE_Z);
  364. }
  365. if(fmode == FRY)
  366. {
  367. ROTATION_Y += FSPEED*100;
  368. SetPlayerAttachedObject(playerid, slno, obid, bodyp, POSITION_X, POSITION_Y, POSITION_Z, ROTATION_X, ROTATION_Y, ROTATION_Z, SCALE_X, SCALE_Y, SCALE_Z);
  369. }
  370. if(fmode == FRZ)
  371. {
  372. ROTATION_Z += FSPEED*100;
  373. SetPlayerAttachedObject(playerid, slno, obid, bodyp, POSITION_X, POSITION_Y, POSITION_Z, ROTATION_X, ROTATION_Y, ROTATION_Z, SCALE_X, SCALE_Y, SCALE_Z);
  374. }
  375. if(fmode == FSX)
  376. {
  377. SCALE_X += FSPEED;
  378. SetPlayerAttachedObject(playerid, slno, obid, bodyp, POSITION_X, POSITION_Y, POSITION_Z, ROTATION_X, ROTATION_Y, ROTATION_Z, SCALE_X, SCALE_Y, SCALE_Z);
  379. }
  380. if(fmode == FSY)
  381. {
  382. SCALE_Y += FSPEED;
  383. SetPlayerAttachedObject(playerid, slno, obid, bodyp, POSITION_X, POSITION_Y, POSITION_Z, ROTATION_X, ROTATION_Y, ROTATION_Z, SCALE_X, SCALE_Y, SCALE_Z);
  384. }
  385. if(fmode == FSZ)
  386. {
  387. SCALE_Z += FSPEED;
  388. SetPlayerAttachedObject(playerid, slno, obid, bodyp, POSITION_X, POSITION_Y, POSITION_Z, ROTATION_X, ROTATION_Y, ROTATION_Z, SCALE_X, SCALE_Y, SCALE_Z);
  389. }
  390. if(fmode == FNONE)
  391. {
  392. fmode = FPX;
  393. }
  394. return 1;
  395. }
  396. CMD:vzf(playerid,params[])
  397. {
  398. if(fmode == FPX)
  399. {
  400. VPOSITION_X +=FSPEED;
  401. DestroyObject(GetPVarInt(playerid,"neon"));
  402. SetPVarInt(playerid,"neon",CreateObject(vobid,0,0,0,0,0,0));
  403. AttachObjectToVehicle(GetPVarInt(playerid,"neon"),GetPlayerVehicleID(playerid),VPOSITION_X,VPOSITION_Y,VPOSITION_Z,VROTATION_X,VROTATION_Y,VROTATION_Z);
  404. }
  405. if(fmode == FPY)
  406. {
  407. VPOSITION_Y += FSPEED;
  408. DestroyObject(GetPVarInt(playerid,"neon"));
  409. SetPVarInt(playerid,"neon",CreateObject(vobid,0,0,0,0,0,0));
  410. AttachObjectToVehicle(GetPVarInt(playerid,"neon"),GetPlayerVehicleID(playerid),VPOSITION_X,VPOSITION_Y,VPOSITION_Z,VROTATION_X,VROTATION_Y,VROTATION_Z);
  411. }
  412. if(fmode == FPZ)
  413. {
  414. VPOSITION_Z += FSPEED;
  415. DestroyObject(GetPVarInt(playerid,"neon"));
  416. SetPVarInt(playerid,"neon",CreateObject(vobid,0,0,0,0,0,0));
  417. AttachObjectToVehicle(GetPVarInt(playerid,"neon"),GetPlayerVehicleID(playerid),VPOSITION_X,VPOSITION_Y,VPOSITION_Z,VROTATION_X,VROTATION_Y,VROTATION_Z);
  418. }
  419. if(fmode == FRX)
  420. {
  421. VROTATION_X += FSPEED*100;
  422. DestroyObject(GetPVarInt(playerid,"neon"));
  423. SetPVarInt(playerid,"neon",CreateObject(vobid,0,0,0,0,0,0));
  424. AttachObjectToVehicle(GetPVarInt(playerid,"neon"),GetPlayerVehicleID(playerid),VPOSITION_X,VPOSITION_Y,VPOSITION_Z,VROTATION_X,VROTATION_Y,VROTATION_Z);
  425. }
  426. if(fmode == FRY)
  427. {
  428. VROTATION_Y += FSPEED*100;
  429. DestroyObject(GetPVarInt(playerid,"neon"));
  430. SetPVarInt(playerid,"neon",CreateObject(vobid,0,0,0,0,0,0));
  431. AttachObjectToVehicle(GetPVarInt(playerid,"neon"),GetPlayerVehicleID(playerid),VPOSITION_X,VPOSITION_Y,VPOSITION_Z,VROTATION_X,VROTATION_Y,VROTATION_Z);
  432. }
  433. if(fmode == FRZ)
  434. {
  435. VROTATION_Z += FSPEED*100;
  436. DestroyObject(GetPVarInt(playerid,"neon"));
  437. SetPVarInt(playerid,"neon",CreateObject(vobid,0,0,0,0,0,0));
  438. AttachObjectToVehicle(GetPVarInt(playerid,"neon"),GetPlayerVehicleID(playerid),VPOSITION_X,VPOSITION_Y,VPOSITION_Z,VROTATION_X,VROTATION_Y,VROTATION_Z);
  439. }
  440. if(fmode == FNONE)
  441. {
  442. fmode = FPX;
  443. }
  444. return 1;
  445. }
  446. CMD:nf(playerid,params[])
  447. {
  448. if(fmode == FPX)
  449. {
  450. POSITION_X -= FSPEED;
  451. SetPlayerAttachedObject(playerid, slno, obid, bodyp, POSITION_X, POSITION_Y, POSITION_Z, ROTATION_X, ROTATION_Y, ROTATION_Z, SCALE_X, SCALE_Y, SCALE_Z);
  452. }
  453. if(fmode == FPY)
  454. {
  455. POSITION_Y -= FSPEED;
  456. SetPlayerAttachedObject(playerid, slno, obid, bodyp, POSITION_X, POSITION_Y, POSITION_Z, ROTATION_X, ROTATION_Y, ROTATION_Z, SCALE_X, SCALE_Y, SCALE_Z);
  457. }
  458. if(fmode == FPZ)
  459. {
  460. POSITION_Z -= FSPEED;
  461. SetPlayerAttachedObject(playerid, slno, obid, bodyp, POSITION_X, POSITION_Y, POSITION_Z, ROTATION_X, ROTATION_Y, ROTATION_Z, SCALE_X, SCALE_Y, SCALE_Z);
  462. }
  463. if(fmode == FRX)
  464. {
  465. ROTATION_X -= FSPEED*100;
  466. SetPlayerAttachedObject(playerid, slno, obid, bodyp, POSITION_X, POSITION_Y, POSITION_Z, ROTATION_X, ROTATION_Y, ROTATION_Z, SCALE_X, SCALE_Y, SCALE_Z);
  467. }
  468. if(fmode == FRY)
  469. {
  470. ROTATION_Y -= FSPEED*100;
  471. SetPlayerAttachedObject(playerid, slno, obid, bodyp, POSITION_X, POSITION_Y, POSITION_Z, ROTATION_X, ROTATION_Y, ROTATION_Z, SCALE_X, SCALE_Y, SCALE_Z);
  472. }
  473. if(fmode == FRZ)
  474. {
  475. ROTATION_Z -= FSPEED*100;
  476. SetPlayerAttachedObject(playerid, slno, obid, bodyp, POSITION_X, POSITION_Y, POSITION_Z, ROTATION_X, ROTATION_Y, ROTATION_Z, SCALE_X, SCALE_Y, SCALE_Z);
  477. }
  478. if(fmode == FSX)
  479. {
  480. SCALE_X -= FSPEED;
  481. SetPlayerAttachedObject(playerid, slno, obid, bodyp, POSITION_X, POSITION_Y, POSITION_Z, ROTATION_X, ROTATION_Y, ROTATION_Z, SCALE_X, SCALE_Y, SCALE_Z);
  482. }
  483. if(fmode == FSY)
  484. {
  485. SCALE_Y -= FSPEED;
  486. SetPlayerAttachedObject(playerid, slno, obid, bodyp, POSITION_X, POSITION_Y, POSITION_Z, ROTATION_X, ROTATION_Y, ROTATION_Z, SCALE_X, SCALE_Y, SCALE_Z);
  487. }
  488. if(fmode == FSZ)
  489. {
  490. SCALE_Z -= FSPEED;
  491. SetPlayerAttachedObject(playerid, slno, obid, bodyp, POSITION_X, POSITION_Y, POSITION_Z, ROTATION_X, ROTATION_Y, ROTATION_Z, SCALE_X, SCALE_Y, SCALE_Z);
  492. }
  493. if(fmode == FNONE)
  494. {
  495. fmode = FPX;
  496. }
  497. return 1;
  498. }
  499. CMD:vnf(playerid,params[])
  500. {
  501. if(fmode == FPX)
  502. {
  503. VPOSITION_X -= FSPEED;
  504. DestroyObject(GetPVarInt(playerid,"neon"));
  505. SetPVarInt(playerid,"neon",CreateObject(vobid,0,0,0,0,0,0));
  506. AttachObjectToVehicle(GetPVarInt(playerid,"neon"),GetPlayerVehicleID(playerid),VPOSITION_X,VPOSITION_Y,VPOSITION_Z,VROTATION_X,VROTATION_Y,VROTATION_Z);
  507. }
  508. if(fmode == FPY)
  509. {
  510. VPOSITION_Y -= FSPEED;
  511. DestroyObject(GetPVarInt(playerid,"neon"));
  512. SetPVarInt(playerid,"neon",CreateObject(vobid,0,0,0,0,0,0));
  513. AttachObjectToVehicle(GetPVarInt(playerid,"neon"),GetPlayerVehicleID(playerid),VPOSITION_X,VPOSITION_Y,VPOSITION_Z,VROTATION_X,VROTATION_Y,VROTATION_Z);
  514. }
  515. if(fmode == FPZ)
  516. {
  517. VPOSITION_Z -= FSPEED;
  518. DestroyObject(GetPVarInt(playerid,"neon"));
  519. SetPVarInt(playerid,"neon",CreateObject(vobid,0,0,0,0,0,0));
  520. AttachObjectToVehicle(GetPVarInt(playerid,"neon"),GetPlayerVehicleID(playerid),VPOSITION_X,VPOSITION_Y,VPOSITION_Z,VROTATION_X,VROTATION_Y,VROTATION_Z);
  521. }
  522. if(fmode == FRX)
  523. {
  524. VROTATION_X -= FSPEED*100;
  525. DestroyObject(GetPVarInt(playerid,"neon"));
  526. SetPVarInt(playerid,"neon",CreateObject(vobid,0,0,0,0,0,0));
  527. AttachObjectToVehicle(GetPVarInt(playerid,"neon"),GetPlayerVehicleID(playerid),VPOSITION_X,VPOSITION_Y,VPOSITION_Z,VROTATION_X,VROTATION_Y,VROTATION_Z);
  528. }
  529. if(fmode == FRY)
  530. {
  531. VROTATION_Y -= FSPEED*100;
  532. DestroyObject(GetPVarInt(playerid,"neon"));
  533. SetPVarInt(playerid,"neon",CreateObject(vobid,0,0,0,0,0,0));
  534. AttachObjectToVehicle(GetPVarInt(playerid,"neon"),GetPlayerVehicleID(playerid),VPOSITION_X,VPOSITION_Y,VPOSITION_Z,VROTATION_X,VROTATION_Y,VROTATION_Z);
  535. }
  536. if(fmode == FRZ)
  537. {
  538. VROTATION_Z -= FSPEED*100;
  539. DestroyObject(GetPVarInt(playerid,"neon"));
  540. SetPVarInt(playerid,"neon",CreateObject(vobid,0,0,0,0,0,0));
  541. AttachObjectToVehicle(GetPVarInt(playerid,"neon"),GetPlayerVehicleID(playerid),VPOSITION_X,VPOSITION_Y,VPOSITION_Z,VROTATION_X,VROTATION_Y,VROTATION_Z);
  542. }
  543. if(fmode == FNONE)
  544. {
  545. fmode = FPX;
  546. }
  547. return 1;
  548. }
  549. CMD:aexport(playerid, params[])
  550. {
  551. new data[256];
  552. format(data, sizeof data, "AOC.pwn");
  553. slfc +=1;
  554. new File:fhandler = fopen(data, io_append);
  555. format(data, sizeof data, "CMD:test%d(playerid, params[])\n{\n",slfc);
  556. fwrite(fhandler, data);
  557. SendClientMessage(playerid,LIGHTBLUE,"Code Save in scriptfiles/AOC.pwn");
  558. format(data, sizeof data, "SetPlayerAttachedObject(playerid,%d, %d,%d,%f,%f,%f,%f,%f,%f,%f,%f,%f);",
  559. slno,obid,bodyp,
  560. POSITION_X,POSITION_Y,POSITION_Z,
  561. ROTATION_X,ROTATION_Y,ROTATION_Z,
  562. SCALE_X,SCALE_Y,SCALE_Z);
  563. fwrite(fhandler, data);
  564. SendClientMessage(playerid, -1, data);
  565. format(data, sizeof data, "\nreturn 1;\n");
  566. fwrite(fhandler, data);
  567. format(data, sizeof data, "}\n");
  568. fwrite(fhandler, data);
  569. fclose(fhandler);
  570. cmd_rall(playerid,"");
  571. return true;
  572. }
  573. CMD:vexport(playerid, params[])
  574. {
  575. new data[256];
  576. format(data, sizeof data, "AOC.pwn");
  577. slfc +=1;
  578. new File:fhandler = fopen(data, io_append);
  579. format(data, sizeof data, "CMD:test%d(playerid, params[])\n{\nnew obdd = CreateObject(%d,0,0,-1000,0,0,0,100);",slfc,vobid);
  580. fwrite(fhandler, data);
  581. SendClientMessage(playerid,LIGHTBLUE,"Code Save in scriptfiles/AOC.pwn");
  582. format(data, sizeof data, "\nAttachObjectToVehicle(obdd, GetPlayerVehicleID(playerid),%f,%f,%f,%f,%f,%f);",VPOSITION_X,VPOSITION_Y,VPOSITION_Z,VROTATION_X,VROTATION_Y,VROTATION_Z);
  583. fwrite(fhandler, data);
  584. format(data, sizeof data, "\nreturn 1;\n");
  585. fwrite(fhandler, data);
  586. format(data, sizeof data, "}\n");
  587. fwrite(fhandler, data);
  588. fclose(fhandler);
  589. format(data, sizeof data, "\nAttachObjectToVehicle(%d, GetPlayerVehicleID(playerid),%f,%f,%f,%f,%f,%f);",vobid,VPOSITION_X,VPOSITION_Y,VPOSITION_Z,VROTATION_X,VROTATION_Y,VROTATION_Z), SendClientMessage(playerid, -1, data);
  590. cmd_rall(playerid,"");
  591. return true;
  592. }
  593. CMD:rall(playerid,params[])
  594. {
  595. POSITION_X =0,
  596. POSITION_Y=0,
  597. POSITION_Z=0,
  598. ROTATION_X=0,
  599. ROTATION_Y=0,
  600. ROTATION_Z=0,
  601. SCALE_X=1.0,
  602. SCALE_Y=1.0,
  603. SCALE_Z=1.0;
  604. return 1;
  605. }
  606. CMD:rall2(playerid,params[])
  607. {
  608. VPOSITION_X =0,
  609. VPOSITION_Y=0,
  610. VPOSITION_Z=0,
  611. VROTATION_X=0,
  612. VROTATION_Y=0,
  613. VROTATION_Z=0;
  614. return 1;
  615. }
  616. CMD:px(playerid,params[])
  617. {
  618. fmode = FPX;
  619. return 1;
  620. }
  621. CMD:py(playerid,params[])
  622. {
  623. fmode = FPY;
  624. return 1;
  625. }
  626. CMD:pz(playerid,params[])
  627. {
  628. fmode = FPZ;
  629. return 1;
  630. }
  631. CMD:rx(playerid,params[])
  632. {
  633. fmode = FRX;
  634. return 1;
  635. }
  636. CMD:ry(playerid,params[])
  637. {
  638. fmode = FRY;
  639. return 1;
  640. }
  641. CMD:rz(playerid,params[])
  642. {
  643. fmode = FRZ;
  644. return 1;
  645. }
  646. CMD:sx(playerid,params[])
  647. {
  648. fmode = FSX;
  649. return 1;
  650. }
  651. CMD:sy(playerid,params[])
  652. {
  653. fmode = FSY;
  654. return 1;
  655. }
  656. CMD:sz(playerid,params[])
  657. {
  658. fmode = FSZ;
  659. return 1;
  660. }
  661. CMD:dao(playerid,params[])
  662. {
  663. if(errors == 3) return SendClientMessage(playerid,COLOR_RED,"ERROR: You Must end Your Edit!");
  664. if(errors == 1) return SendClientMessage(playerid,COLOR_RED,"ERROR: You Must end You AO!");
  665. ShowPlayerDialog(playerid, D_DAO, DIALOG_STYLE_MSGBOX, "###:.Delete Attached Object.:###", " -AO = Undo \n All = All Attached Objects ", "-AO", "All AO");
  666. return 1;
  667. }
  668.  
  669. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  670. {
  671. if(dialogid == D_BP)
  672. {
  673. if(response)
  674. {
  675. if(listitem == 0)
  676. {
  677. bodyp = 1;
  678. ShowPlayerDialog(playerid,D_CO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  679. }
  680. if(listitem == 1)
  681. {
  682. bodyp = 2;
  683. ShowPlayerDialog(playerid,D_CO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  684. }
  685. if(listitem == 2)
  686. {
  687. bodyp = 3;
  688. ShowPlayerDialog(playerid,D_CO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  689. }
  690. if(listitem == 3)
  691. {
  692. bodyp = 4;
  693. ShowPlayerDialog(playerid,D_CO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  694. }
  695. if(listitem == 4)
  696. {
  697. bodyp = 5;
  698. ShowPlayerDialog(playerid,D_CO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  699. }
  700. if(listitem == 5)
  701. {
  702. bodyp = 6;
  703. ShowPlayerDialog(playerid,D_CO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  704. }
  705. if(listitem == 6)
  706. {
  707. bodyp = 7;
  708. ShowPlayerDialog(playerid,D_CO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  709. }
  710. if(listitem == 7)
  711. {
  712. bodyp = 8;
  713. ShowPlayerDialog(playerid,D_CO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  714. }
  715. if(listitem == 8)
  716. {
  717. bodyp = 9;
  718. ShowPlayerDialog(playerid,D_CO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  719. }
  720. if(listitem == 9)
  721. {
  722. bodyp = 10;
  723. ShowPlayerDialog(playerid,D_CO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  724. }
  725. if(listitem == 10)
  726. {
  727. bodyp = 11;
  728. ShowPlayerDialog(playerid,D_CO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  729. }
  730. if(listitem == 11)
  731. {
  732. bodyp = 12;
  733. ShowPlayerDialog(playerid,D_CO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  734. }
  735. if(listitem == 12)
  736. {
  737. bodyp = 13;
  738. ShowPlayerDialog(playerid,D_CO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  739. }
  740. if(listitem == 13)
  741. {
  742. bodyp = 14;
  743. ShowPlayerDialog(playerid,D_CO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  744. }
  745. if(listitem == 14)
  746. {
  747. bodyp = 15;
  748. ShowPlayerDialog(playerid,D_CO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  749. }
  750. if(listitem == 15)
  751. {
  752. bodyp = 16;
  753. ShowPlayerDialog(playerid,D_CO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  754. }
  755. if(listitem == 16)
  756. {
  757. bodyp = 17;
  758. ShowPlayerDialog(playerid,D_CO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  759. }
  760. if(listitem == 17)
  761. {
  762. bodyp = 18;
  763. ShowPlayerDialog(playerid,D_CO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  764. }
  765. return 1;
  766. }
  767. }
  768. if(dialogid == D_CO)
  769. {
  770. if(response)
  771. {
  772. new zobid = strval(inputtext);
  773. if(!strlen(inputtext)) return ShowPlayerDialog(playerid,D_CO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  774. if(zobid < 1 || zobid > 19901)
  775. {
  776. SendClientMessage(playerid, -1, "Invalid Object ID.");
  777. ShowPlayerDialog(playerid,D_CO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  778. return 1;
  779. }
  780. else
  781. {
  782. obid =zobid;
  783. slno +=1;
  784. fmsao = 0;
  785. KillTimer(trmatimer);
  786. //
  787. TextDrawShowForPlayer(playerid,tdaoc);
  788. //
  789. S3B5
  790. cmd_aedit(playerid,"");
  791. return 1;
  792. }
  793. }
  794. else
  795. {
  796. SendClientMessage(playerid, -1, "Object ID selection canceled.");
  797. }
  798. }
  799. if(dialogid == D_VCO)
  800. {
  801. if(response)
  802. {
  803. new zobid = strval(inputtext);
  804. if(!strlen(inputtext)) return ShowPlayerDialog(playerid,D_VCO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  805. if(zobid < 1 || zobid > 19901)
  806. {
  807. SendClientMessage(playerid, -1, "Invalid Object ID.");
  808. ShowPlayerDialog(playerid,D_VCO, DIALOG_STYLE_INPUT, "Object ID","{00FFFF}Type Object ID.","Ok","Cancel");
  809. return 1;
  810. }
  811. else
  812. {
  813. vobid =zobid;
  814. slno +=1;
  815. fmsao = 0;
  816. KillTimer(trmatimer);
  817. //
  818. TextDrawShowForPlayer(playerid,tdvoc);
  819. //
  820. S3B4
  821. cmd_vedit(playerid,"");
  822. return 1;
  823. }
  824. }
  825. else
  826. {
  827. SendClientMessage(playerid, -1, "Object ID selection canceled.");
  828. }
  829. }
  830. if(dialogid == D_DAO)
  831. {
  832. if(response)
  833. {
  834. if(slno <= 0) return SendClientMessage(playerid,COLOR_RED,"ERROR: No Attached Object to Delete.");
  835. RemovePlayerAttachedObject( playerid, slno );
  836. slno -=1;
  837. ShowPlayerDialog(playerid, D_DAO, DIALOG_STYLE_MSGBOX, "###:.Delete Attached Object.:###", "Delete AO ", "Undo", "Quit");
  838. return 1;
  839. }
  840. else
  841. {
  842. for ( new i = 0; i < 300; i ++ )
  843. if ( IsPlayerAttachedObjectSlotUsed( playerid, i ) )
  844. RemovePlayerAttachedObject( playerid, i );
  845. }
  846. }
  847. if(dialogid == D_UNDO)
  848. {
  849. if(response)
  850. {
  851. if(slno <= 0) return SendClientMessage(playerid,COLOR_RED,"ERROR: No Attached Object to Delete.");
  852. RemovePlayerAttachedObject( playerid, slno );
  853. slno -=1;
  854. ShowPlayerDialog(playerid, D_UNDO, DIALOG_STYLE_MSGBOX, "###:.Delete Attached Object.:###", "Delete AO ", "Undo", "Quit");
  855. return 1;
  856. }
  857. }
  858. return 1;
  859. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement