Advertisement
Guest User

Untitled

a guest
Jan 12th, 2013
582
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.45 KB | None | 0 0
  1. //------------------------------------------------------------------------------
  2.  
  3. #include <a_samp>
  4. #pragma tabsize 0
  5.  
  6. #define COLOR_GREY 0xAFAFAFAA
  7. #define COLOR_GREEN 0x33AA33AA
  8. #define COLOR_RED 0xAA3333AA
  9. #define COLOR_YELLOW 0xFFFF00AA
  10. #define COLOR_WHITE 0xFFFFFFAA
  11. #define DIALOG_ATTACH_INDEX 13500
  12. #define DIALOG_ATTACH_INDEX_SELECTION DIALOG_ATTACH_INDEX+1
  13. #define DIALOG_ATTACH_EDITREPLACE DIALOG_ATTACH_INDEX+2
  14. #define DIALOG_ATTACH_MODEL_SELECTION DIALOG_ATTACH_INDEX+3
  15. #define DIALOG_ATTACH_BONE_SELECTION DIALOG_ATTACH_INDEX+4
  16. #define DIALOG_WEAPONS 4
  17. //------------------------------------------------------------------------------
  18.  
  19.  
  20. enum AttachmentEnum
  21. {
  22. attachmodel,
  23. attachname[24]
  24. }
  25. //------------------------------------------------------------------------------
  26. new AttachmentObjects[][AttachmentEnum] = {
  27. {18632, "FishingRod"},
  28. {18633, "GTASAWrench1"},
  29. {18634, "GTASACrowbar1"},
  30. {18635, "GTASAHammer1"},
  31. {18636, "PoliceCap1"},
  32. {18637, "PoliceShield1"},
  33. {18638, "HardHat1"},
  34. {18639, "BlackHat1"},
  35. {18640, "Hair1"},
  36. {18975, "Hair2"},
  37. {19136, "Hair4"},
  38. {19274, "Hair5"},
  39. {18641, "Flashlight1"},
  40. {18642, "Taser1"},
  41. {18643, "LaserPointer1"},
  42. {19080, "LaserPointer2"},
  43. {19081, "LaserPointer3"},
  44. {19082, "LaserPointer4"},
  45. {19083, "LaserPointer5"},
  46. {19084, "LaserPointer6"},
  47. {18644, "Screwdriver1"},
  48. {18645, "MotorcycleHelmet1"},
  49. {18865, "MobilePhone1"},
  50. {18866, "MobilePhone2"},
  51. {18867, "MobilePhone3"},
  52. {18868, "MobilePhone4"},
  53. {18869, "MobilePhone5"},
  54. {18870, "MobilePhone6"},
  55. {18871, "MobilePhone7"},
  56. {18872, "MobilePhone8"},
  57. {18873, "MobilePhone9"},
  58. {18874, "MobilePhone10"},
  59. {18875, "Pager1"},
  60. {18890, "Rake1"},
  61. {18891, "Bandana1"},
  62. {18892, "Bandana2"},
  63. {18893, "Bandana3"},
  64. {18894, "Bandana4"},
  65. {18895, "Bandana5"},
  66. {18896, "Bandana6"},
  67. {18897, "Bandana7"},
  68. {18898, "Bandana8"},
  69. {18899, "Bandana9"},
  70. {18900, "Bandana10"},
  71. {18901, "Bandana11"},
  72. {18902, "Bandana12"},
  73. {18903, "Bandana13"},
  74. {18904, "Bandana14"},
  75. {18905, "Bandana15"},
  76. {18906, "Bandana16"},
  77. {18907, "Bandana17"},
  78. {18908, "Bandana18"},
  79. {18909, "Bandana19"},
  80. {18910, "Bandana20"},
  81. {18911, "Mask1"},
  82. {18912, "Mask2"},
  83. {18913, "Mask3"},
  84. {18914, "Mask4"},
  85. {18915, "Mask5"},
  86. {18916, "Mask6"},
  87. {18917, "Mask7"},
  88. {18918, "Mask8"},
  89. {18919, "Mask9"},
  90. {18920, "Mask10"},
  91. {18921, "Beret1"},
  92. {18922, "Beret2"},
  93. {18923, "Beret3"},
  94. {18924, "Beret4"},
  95. {18925, "Beret5"},
  96. {18926, "Hat1"},
  97. {18927, "Hat2"},
  98. {18928, "Hat3"},
  99. {18929, "Hat4"},
  100. {18930, "Hat5"},
  101. {18931, "Hat6"},
  102. {18932, "Hat7"},
  103. {18933, "Hat8"},
  104. {18934, "Hat9"},
  105. {18935, "Hat10"},
  106. {18936, "Helmet1"},
  107. {18937, "Helmet2"},
  108. {18938, "Helmet3"},
  109. {18939, "CapBack1"},
  110. {18940, "CapBack2"},
  111. {18941, "CapBack3"},
  112. {18942, "CapBack4"},
  113. {18943, "CapBack5"},
  114. {18944, "HatBoater1"},
  115. {18945, "HatBoater2"},
  116. {18946, "HatBoater3"},
  117. {18947, "HatBowler1"},
  118. {18948, "HatBowler2"},
  119. {18949, "HatBowler3"},
  120. {18950, "HatBowler4"},
  121. {18951, "HatBowler5"},
  122. {18952, "BoxingHelmet1"},
  123. {18953, "CapKnit1"},
  124. {18954, "CapKnit2"},
  125. {18955, "CapOverEye1"},
  126. {18956, "CapOverEye2"},
  127. {18957, "CapOverEye3"},
  128. {18958, "CapOverEye4"},
  129. {18959, "CapOverEye5"},
  130. {18960, "CapRimUp1"},
  131. {18961, "CapTrucker1"},
  132. {18962, "CowboyHat2"},
  133. {18963, "CJElvisHead"},
  134. {18964, "SkullyCap1"},
  135. {18965, "SkullyCap2"},
  136. {18966, "SkullyCap3"},
  137. {18967, "HatMan1"},
  138. {18968, "HatMan2"},
  139. {18969, "HatMan3"},
  140. {18970, "HatTiger1"},
  141. {18971, "HatCool1"},
  142. {18972, "HatCool2"},
  143. {18973, "HatCool3"},
  144. {18974, "MaskZorro1"},
  145. {18976, "MotorcycleHelmet2"},
  146. {18977, "MotorcycleHelmet3"},
  147. {18978, "MotorcycleHelmet4"},
  148. {18979, "MotorcycleHelmet5"},
  149. {19006, "GlassesType1"},
  150. {19007, "GlassesType2"},
  151. {19008, "GlassesType3"},
  152. {19009, "GlassesType4"},
  153. {19010, "GlassesType5"},
  154. {19011, "GlassesType6"},
  155. {19012, "GlassesType7"},
  156. {19013, "GlassesType8"},
  157. {19014, "GlassesType9"},
  158. {19015, "GlassesType10"},
  159. {19016, "GlassesType11"},
  160. {19017, "GlassesType12"},
  161. {19018, "GlassesType13"},
  162. {19019, "GlassesType14"},
  163. {19020, "GlassesType15"},
  164. {19021, "GlassesType16"},
  165. {19022, "GlassesType17"},
  166. {19023, "GlassesType18"},
  167. {19024, "GlassesType19"},
  168. {19025, "GlassesType20"},
  169. {19026, "GlassesType21"},
  170. {19027, "GlassesType22"},
  171. {19028, "GlassesType23"},
  172. {19029, "GlassesType24"},
  173. {19030, "GlassesType25"},
  174. {19031, "GlassesType26"},
  175. {19032, "GlassesType27"},
  176. {19033, "GlassesType28"},
  177. {19034, "GlassesType29"},
  178. {19035, "GlassesType30"},
  179. {19036, "HockeyMask1"},
  180. {19037, "HockeyMask2"},
  181. {19038, "HockeyMask3"},
  182. {19039, "WatchType1"},
  183. {19040, "WatchType2"},
  184. {19041, "WatchType3"},
  185. {19042, "WatchType4"},
  186. {19043, "WatchType5"},
  187. {19044, "WatchType6"},
  188. {19045, "WatchType7"},
  189. {19046, "WatchType8"},
  190. {19047, "WatchType9"},
  191. {19048, "WatchType10"},
  192. {19049, "WatchType11"},
  193. {19050, "WatchType12"},
  194. {19051, "WatchType13"},
  195. {19052, "WatchType14"},
  196. {19053, "WatchType15"},
  197. {19085, "EyePatch1"},
  198. {19086, "ChainsawDildo1"},
  199. {19090, "PomPomBlue"},
  200. {19091, "PomPomRed"},
  201. {19092, "PomPomGreen"},
  202. {19093, "HardHat2"},
  203. {19094, "BurgerShotHat1"},
  204. {19095, "CowboyHat1"},
  205. {19096, "CowboyHat3"},
  206. {19097, "CowboyHat4"},
  207. {19098, "CowboyHat5"},
  208. {19099, "PoliceCap2"},
  209. {19100, "PoliceCap3"},
  210. {19101, "ArmyHelmet1"},
  211. {19102, "ArmyHelmet2"},
  212. {19103, "ArmyHelmet3"},
  213. {19104, "ArmyHelmet4"},
  214. {19105, "ArmyHelmet5"},
  215. {19106, "ArmyHelmet6"},
  216. {19107, "ArmyHelmet7"},
  217. {19108, "ArmyHelmet8"},
  218. {19109, "ArmyHelmet9"},
  219. {19110, "ArmyHelmet10"},
  220. {19111, "ArmyHelmet11"},
  221. {19112, "ArmyHelmet12"},
  222. {19113, "SillyHelmet1"},
  223. {19114, "SillyHelmet2"},
  224. {19115, "SillyHelmet3"},
  225. {19116, "PlainHelmet1"},
  226. {19117, "PlainHelmet2"},
  227. {19118, "PlainHelmet3"},
  228. {19119, "PlainHelmet4"},
  229. {19120, "PlainHelmet5"},
  230. {19137, "CluckinBellHat1"},
  231. {19138, "PoliceGlasses1"},
  232. {19139, "PoliceGlasses2"},
  233. {19140, "PoliceGlasses3"},
  234. {19141, "SWATHelmet1"},
  235. {19142, "SWATArmour1"},
  236. {19160, "HardHat3"},
  237. {19161, "PoliceHat1"},
  238. {19162, "PoliceHat2"},
  239. {19163, "GimpMask1"},
  240. {19317, "bassguitar01"},
  241. {19318, "flyingv01"},
  242. {19319, "warlock01"},
  243. {19330, "fire_hat01"},
  244. {19331, "fire_hat02"},
  245. {19346, "hotdog01"},
  246. {19347, "badge01"},
  247. {19348, "cane01"},
  248. {19349, "monocle01"},
  249. {19350, "moustache01"},
  250. {19351, "moustache02"},
  251. {19352, "tophat01"},
  252. {19487, "tophat02"},
  253. {19488, "HatBowler6"},
  254. {19513, "whitephone"},
  255. {19515, "GreySwatArm"}
  256. };
  257.  
  258. new AttachmentBones[][24] = {
  259. {"Spine"},
  260. {"Head"},
  261. {"Left upper arm"},
  262. {"Right upper arm"},
  263. {"Left hand"},
  264. {"Right hand"},
  265. {"Left thigh"},
  266. {"Right thigh"},
  267. {"Left foot"},
  268. {"Right foot"},
  269. {"Right calf"},
  270. {"Left calf"},
  271. {"Left forearm"},
  272. {"Right forearm"},
  273. {"Left clavicle"},
  274. {"Right clavicle"},
  275. {"Neck"},
  276. {"Jaw"}
  277. };
  278.  
  279. //------------------------------------------------------------------------------
  280.  
  281. #if defined FILTERSCRIPT
  282.  
  283. public OnFilterScriptInit()
  284. {
  285. print("\n--------------------------------------");
  286. print(" Blank Filterscript by your name here");
  287. print("--------------------------------------\n");
  288. return 1;
  289. }
  290.  
  291. public OnFilterScriptExit()
  292. {
  293. return 1;
  294. }
  295.  
  296. #else
  297.  
  298. main()
  299. {
  300. print("\n----------------------------------");
  301. print(" Blank Gamemode by your name here");
  302. print("----------------------------------\n");
  303. }
  304.  
  305. #endif
  306.  
  307. //------------------------------------------------------------------------------
  308. public OnGameModeInit()
  309. {
  310. // Don't use these lines if it's a filterscript
  311. SetGameModeText("Roleplay");
  312. AddPlayerClass(7,1685.7507,-2328.6917,13.5469,0.7175,0,0,0,0,0,0); // Skin
  313. AddPlayerClass(21,1685.7507,-2328.6917,13.5469,0.7175,0,0,0,0,0,0); // Skin
  314. AddPlayerClass(48,1685.7507,-2328.6917,13.5469,0.7175,0,0,0,0,0,0); // Skin
  315. AddPlayerClass(180,1685.7507,-2328.6917,13.5469,0.7175,0,0,0,0,0,0); // Skin
  316. AddPlayerClass(187,1685.7507,-2328.6917,13.5469,0.7175,0,0,0,0,0,0); // Skin
  317. AddPlayerClass(11,1685.7507,-2328.6917,13.5469,0.7175,0,0,0,0,0,0); // Skin
  318. AddPlayerClass(2,1685.7507,-2328.6917,13.5469,0.7175,0,0,0,0,0,0); // Skin
  319. AddStaticVehicle(519,2108.0928,-2469.1130,14.4655,271.0281,1,1); // plane
  320. AddStaticVehicle(519,2107.1128,-2443.6528,14.4689,274.1017,1,1); // plane
  321. AddStaticVehicle(511,2020.9360,-2411.5576,14.9222,3.1962,12,60); // plane
  322. AddStaticVehicle(487,1946.6316,-2646.5762,13.7266,0.2964,12,39); // helicopter
  323. AddStaticVehicle(467,1893.7195,-2185.1782,13.2869,359.8588,2,1); // extracar
  324. AddStaticVehicle(439,2049.3745,-2039.9390,13.4428,358.5837,57,8); // extracar
  325. AddStaticVehicle(509,2389.4939,-1490.9948,23.3403,91.6278,30,1); // RandomBike
  326. AddStaticVehicle(510,2557.8645,-1131.1613,62.9428,357.0557,2,2); // RandomBike
  327. AddStaticVehicle(605,2414.5845,-260.1291,20.2739,88.8256,2,2); // Random car
  328.  
  329. UsePlayerPedAnims();
  330.  
  331.  
  332. return 1;
  333. }
  334. //------------------------------------------------------------------------------
  335.  
  336. public OnGameModeExit()
  337. {
  338. return 1;
  339. }
  340.  
  341. //------------------------------------------------------------------------------
  342. public OnPlayerRequestClass(playerid, classid)
  343. {
  344. SetPlayerPos(playerid, 1544.7887,-1675.4630,13.5591);
  345. SetPlayerFacingAngle(playerid,90.0);
  346. SetPlayerCameraPos(playerid, 1541.5293,-1675.4012,13.5527);
  347. SetPlayerCameraLookAt(playerid, 1544.7887,-1675.4630,13.5591);
  348. return 1;
  349. }
  350. //------------------------------------------------------------------------------
  351.  
  352. public OnPlayerConnect(playerid)
  353. {
  354. return 1;
  355. }
  356. //------------------------------------------------------------------------------
  357. public OnPlayerDisconnect(playerid, reason)
  358. {
  359. return 1;
  360. }
  361. //------------------------------------------------------------------------------
  362. public OnPlayerSpawn(playerid)
  363. {
  364.  
  365. SendClientMessage(playerid, 0xFFFFFFFF, "Hello, welcome to Freeroam! Developed by Templar");
  366. SendClientMessage(playerid, 0xFFFFFFFF, "Type /commands for a list of commands!");
  367. SendClientMessage(playerid, 0xFFFFFFFF, "You will need to use /rules to know the rules of our community!");
  368. SendClientMessage(playerid, 0xFFFFFFFF, "Use /weaponlist to select weapons!");
  369. GivePlayerMoney(playerid, 50000);
  370.  
  371. return 1;
  372. }
  373. //------------------------------------------------------------------------------
  374. public OnPlayerDeath(playerid, killerid, reason)
  375. {
  376. return 1;
  377. }
  378.  
  379. public OnVehicleSpawn(vehicleid)
  380. {
  381. return 1;
  382. }
  383.  
  384. public OnVehicleDeath(vehicleid, killerid)
  385. {
  386. return 1;
  387. }
  388. //------------------------------------------------------------------------------
  389. public OnPlayerText(playerid, text[])
  390. {
  391. return 1;
  392. }
  393. //------------------------------------------------------------------------------
  394. public OnPlayerCommandText(playerid, cmdtext[])
  395. {
  396. if (strcmp("/afk", cmdtext, true, 4) == 0)
  397. {
  398. new name[MAX_PLAYER_NAME];
  399. new string[128];
  400. GetPlayerName(playerid, name, 24);
  401. format(string, sizeof(string), " %s is now Away From Keyboard ", name);
  402. SendClientMessageToAll(0xFF0000AA, string);
  403. ApplyAnimation(playerid,"DANCING","DNCE_M_B",4.0,1,0,0,0,-1);
  404. SendClientMessage(playerid, 0xFF0000AA, "You are now Away From Keyboard and in virtual world 10. If you are back type /back.");
  405. SetPlayerVirtualWorld(playerid, 10);
  406. TogglePlayerControllable(playerid, 0);
  407. SetPlayerChatBubble(playerid, "Away From Keyboard", 0xFFFFFFAA, 100, 100000000000);
  408. return 1;
  409. }
  410. if (strcmp("/back", cmdtext, true, 5) == 0)
  411. {
  412. new name[MAX_PLAYER_NAME];
  413. new string[128];
  414. GetPlayerName(playerid, name, 24);
  415. format(string, sizeof(string), "%s is now Back from being Away From Keyboard (AFK)", name);
  416. SendClientMessageToAll(0xFF0000AA, string);
  417. ClearAnimations(playerid, 0);
  418. SendClientMessage(playerid, 0xFF0000AA, "You are now Back in virtual world 0 and you are not AFK anymore.");
  419. SetPlayerVirtualWorld(playerid, 0);
  420. TogglePlayerControllable(playerid, 1);
  421. SetPlayerChatBubble(playerid, " ", 0xFFFFFFAA, 100, 10);
  422. return 1;
  423. }
  424. if(!strcmp(cmdtext, "/attachments", true))
  425. {
  426. new string[128];
  427. for(new x;x<MAX_PLAYER_ATTACHED_OBJECTS;x++)
  428. {
  429. if(IsPlayerAttachedObjectSlotUsed(playerid, x)) format(string, sizeof(string), "%s%d (Used)\n", string, x);
  430. else format(string, sizeof(string), "%s%d\n", string, x);
  431. }
  432. ShowPlayerDialog(playerid, DIALOG_ATTACH_INDEX_SELECTION, DIALOG_STYLE_LIST, \
  433. "{FF0000}Attachments - Index Selection", string, "Select", "Cancel");
  434. return 1;
  435. }
  436. if(strcmp(cmdtext, "/tele1") == 0)
  437. {
  438. SetPlayerPos(playerid, 1683.6252,-2334.4385,23.6551);
  439. return 1;
  440. }
  441. if(strcmp(cmdtext, "/tele2") == 0)
  442. {
  443. SetPlayerPos(playerid, 1745.4346,-2288.8623,27.3313);
  444. return 1;
  445. }
  446. if(strcmp(cmdtext, "/tele3") == 0)
  447. {
  448. SetPlayerPos(playerid, 1684.1427,-2237.3889,23.6551);
  449. return 1;
  450. }
  451. if(strcmp(cmdtext, "/tele4") == 0)
  452. {
  453. SetPlayerPos(playerid, 1630.0494,-2286.9063,94.1328);
  454. return 1;
  455. }
  456. if(strcmp(cmdtext, "/commands") == 0)
  457. {
  458. ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX,"{FF0000}Commands{FF0000}", "{FF0000}/tele1\n/tele2\n/tele3\n/tele4\n/afk\n/back\n/kill\n/weaponlist\n/rules\n/createstrip\n/removestrip\n/removeallstrip{FF0000}", "Ok", "Exit");
  459. return 1;
  460. }
  461. if(strcmp(cmdtext, "/rules") == 0)
  462. {
  463. ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX,"{FF0000}Rules{FF0000}", "{FF0000}1. No hacking\n2. Respect admins\n3. Do not be a jerk to others\n4. Do not bug abuse\n5. No car killing\n6. No spawn killing\n7. Do not abuse /report command{FF0000}", "Ok", "Exit");
  464. return 1;
  465. }
  466. if(strcmp(cmdtext, "/kill",true) == 0)
  467. {
  468. SetPlayerHealth(playerid, 0);
  469. return 1;
  470. }
  471. if(strcmp(cmdtext, "/weaponlist",true) == 0)
  472. {
  473. ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "{FF0000}Weapons{FF0000}", "Desert Eagle\nAK-47\nCombat Shotgun\nSawnoff\nTec9\nUZI\nM4\nMP5\nRPG\nSniper\nMoltov{FF0000}", "Select", "Close");
  474. return 1;
  475. }
  476. return 0;
  477. }
  478.  
  479. //------------------------------------------------------------------------------
  480. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  481. {
  482. return 1;
  483. }
  484.  
  485. public OnPlayerExitVehicle(playerid, vehicleid)
  486. {
  487. return 1;
  488. }
  489.  
  490. public OnPlayerStateChange(playerid, newstate, oldstate)
  491. {
  492. return 1;
  493. }
  494.  
  495. public OnPlayerEnterCheckpoint(playerid)
  496. {
  497. return 1;
  498. }
  499.  
  500. public OnPlayerLeaveCheckpoint(playerid)
  501. {
  502. return 1;
  503. }
  504.  
  505. public OnPlayerEnterRaceCheckpoint(playerid)
  506. {
  507. return 1;
  508. }
  509.  
  510. public OnPlayerLeaveRaceCheckpoint(playerid)
  511. {
  512. return 1;
  513. }
  514.  
  515. public OnRconCommand(cmd[])
  516. {
  517. return 1;
  518. }
  519.  
  520. public OnPlayerRequestSpawn(playerid)
  521. {
  522. return 1;
  523. }
  524.  
  525. public OnObjectMoved(objectid)
  526. {
  527. return 1;
  528. }
  529.  
  530. public OnPlayerObjectMoved(playerid, objectid)
  531. {
  532. return 1;
  533. }
  534.  
  535. public OnPlayerPickUpPickup(playerid, pickupid)
  536. {
  537. return 1;
  538. }
  539.  
  540. public OnVehicleMod(playerid, vehicleid, componentid)
  541. {
  542. return 1;
  543. }
  544.  
  545. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  546. {
  547. return 1;
  548. }
  549.  
  550. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  551. {
  552. return 1;
  553. }
  554.  
  555. public OnPlayerSelectedMenuRow(playerid, row)
  556. {
  557. return 1;
  558. }
  559.  
  560. public OnPlayerExitedMenu(playerid)
  561. {
  562. return 1;
  563. }
  564.  
  565. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  566. {
  567. return 1;
  568. }
  569.  
  570. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  571. {
  572. return 1;
  573. }
  574.  
  575. public OnRconLoginAttempt(ip[], password[], success)
  576. {
  577. return 1;
  578. }
  579.  
  580. public OnPlayerUpdate(playerid)
  581. {
  582. return 1;
  583. }
  584.  
  585. public OnPlayerStreamIn(playerid, forplayerid)
  586. {
  587. return 1;
  588. }
  589.  
  590. public OnPlayerStreamOut(playerid, forplayerid)
  591. {
  592. return 1;
  593. }
  594.  
  595. public OnVehicleStreamIn(vehicleid, forplayerid)
  596. {
  597. return 1;
  598. }
  599.  
  600. public OnVehicleStreamOut(vehicleid, forplayerid)
  601. {
  602. return 1;
  603. }
  604. //------------------------------------------------------------------------------
  605. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  606. {
  607. switch(dialogid)
  608. {
  609. case DIALOG_ATTACH_INDEX_SELECTION:
  610. {
  611. if(response)
  612. {
  613. if(IsPlayerAttachedObjectSlotUsed(playerid, listitem))
  614. {
  615. ShowPlayerDialog(playerid, DIALOG_ATTACH_EDITREPLACE, DIALOG_STYLE_MSGBOX, \
  616. "{FF0000}Attachments", "Do you wish to edit the attachment in that slot, or delete it?", "Edit", "Delete");
  617. }
  618. else
  619. {
  620. new string[4000+1];
  621. for(new x;x<sizeof(AttachmentObjects);x++)
  622. {
  623. format(string, sizeof(string), "%s%s\n", string, AttachmentObjects[x][attachname]);
  624. }
  625. ShowPlayerDialog(playerid, DIALOG_ATTACH_MODEL_SELECTION, DIALOG_STYLE_LIST, \
  626. "{FF0000}Attachments - Model Selection", string, "Select", "Cancel");
  627. }
  628. SetPVarInt(playerid, "AttachmentIndexSel", listitem);
  629. }
  630. return 1;
  631. }
  632. case DIALOG_ATTACH_EDITREPLACE:
  633. {
  634. if(response) EditAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel"));
  635. else RemovePlayerAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel"));
  636. DeletePVar(playerid, "AttachmentIndexSel");
  637. return 1;
  638. }
  639. case DIALOG_ATTACH_MODEL_SELECTION:
  640. {
  641. if(response)
  642. {
  643. if(GetPVarInt(playerid, "AttachmentUsed") == 1) EditAttachedObject(playerid, listitem);
  644. else
  645. {
  646. SetPVarInt(playerid, "AttachmentModelSel", AttachmentObjects[listitem][attachmodel]);
  647. new string[256+1];
  648. for(new x;x<sizeof(AttachmentBones);x++)
  649. {
  650. format(string, sizeof(string), "%s%s\n", string, AttachmentBones[x]);
  651. }
  652. ShowPlayerDialog(playerid, DIALOG_ATTACH_BONE_SELECTION, DIALOG_STYLE_LIST, \
  653. "{FF0000}Attachments - Bone Selection", string, "Select", "Cancel");
  654. }
  655. }
  656. else DeletePVar(playerid, "AttachmentIndexSel");
  657. return 1;
  658. }
  659. case DIALOG_ATTACH_BONE_SELECTION:
  660. {
  661. if(response)
  662. {
  663. SetPlayerAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel"), GetPVarInt(playerid, "AttachmentModelSel"), listitem+1);
  664. EditAttachedObject(playerid, GetPVarInt(playerid, "AttachmentIndexSel"));
  665. SendClientMessage(playerid, 0xFFFFFFFF, "Hint: Use {FFFF00}~k~~PED_SPRINT~{FFFFFF} to look around.");
  666. }
  667. DeletePVar(playerid, "AttachmentIndexSel");
  668. DeletePVar(playerid, "AttachmentModelSel");
  669. return 1;
  670. }
  671. }
  672. if(dialogid == DIALOG_WEAPONS)
  673. {
  674. if(response) // If they clicked 'Select' or double-clicked a weapon
  675. {
  676. // Give them the weapon
  677. if(listitem == 0) // They selected the first item - Desert Eagle
  678. {
  679. GivePlayerWeapon(playerid, WEAPON_DEAGLE, 5000); // Give them a desert eagle
  680. }
  681. if(listitem == 1) // They selected the second item - AK-47
  682. {
  683. GivePlayerWeapon(playerid, WEAPON_AK47, 5000); // Give them an AK-47
  684. }
  685. if(listitem == 2) // They selected the third item - Desert Eagle
  686. {
  687. GivePlayerWeapon(playerid, WEAPON_SHOTGSPA, 5000); // Give them a Combat Shotgun
  688. }
  689. if(listitem == 3) // They selected the third item - Sawnoff
  690. {
  691. GivePlayerWeapon(playerid, 26, 5000); //Give playerid sawnoff shotgun with 5000 ammo
  692. }
  693. if(listitem == 4) // They selected the third item - Tec9
  694. {
  695. GivePlayerWeapon(playerid, 32, 5000); //Give playerid sawnoff shotgun with 5000 ammo
  696. }
  697. if(listitem == 5) // They selected the third item - UZI
  698. {
  699. GivePlayerWeapon(playerid, 28, 5000); //Give playerid sawnoff shotgun with 5000 ammo
  700. }
  701. if(listitem == 6) // They selected the third item - MP5
  702. {
  703. GivePlayerWeapon(playerid, 31, 5000); //Give playerid sawnoff shotgun with 500 ammo
  704. }
  705. if(listitem == 7) // They selected the third item - Sawnoff
  706. {
  707. GivePlayerWeapon(playerid, 29, 5000); //Give playerid sawnoff shotgun with 500 ammo
  708. }
  709. if(listitem == 8) // They selected the third item - Sawnoff
  710. {
  711. GivePlayerWeapon(playerid, 35, 5); //Give playerid sawnoff shotgun with 500 ammo
  712. }
  713. if(listitem == 9) // They selected the third item - Sawnoff
  714. {
  715. GivePlayerWeapon(playerid, 34, 5000); //Give playerid sawnoff shotgun with 500 ammo
  716. }
  717. if(listitem == 10) // They selected the third item - Sawnoff
  718. {
  719. GivePlayerWeapon(playerid, 18, 12); //Give playerid sawnoff shotgun with 500 ammo
  720. }
  721. }
  722. return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
  723. }
  724.  
  725. return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
  726. }
  727.  
  728.  
  729. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  730. {
  731. return 1;
  732. }
  733. //------------------------------------------------------------------------------
  734. public OnPlayerEditAttachedObject( playerid, response, index, modelid, boneid,
  735. Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ,
  736. Float:fRotX, Float:fRotY, Float:fRotZ,
  737. Float:fScaleX, Float:fScaleY, Float:fScaleZ )
  738. {
  739. new debug_string[256+1];
  740. format(debug_string,256,"SetPlayerAttachedObject(playerid,%d,%d,%d,%f,%f,%f,%f,%f,%f,%f,%f,%f)",
  741. index,modelid,boneid,fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ,fScaleX,fScaleY,fScaleZ);
  742.  
  743. print(debug_string);
  744. //SendClientMessage(playerid, 0xFFFFFFFF, debug_string);
  745.  
  746. SetPlayerAttachedObject(playerid,index,modelid,boneid,fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ,fScaleX,fScaleY,fScaleZ);
  747. SendClientMessage(playerid, 0xFFFFFFFF, "You finished editing an attached object");
  748.  
  749. return 1;
  750. }
  751. //------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement