Advertisement
Guest User

Backpack by Hunk

a guest
Feb 18th, 2018
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.62 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows.Forms;
  7. using GTA;
  8. using GTA.Native;
  9. using GTA.Math;
  10. using NativeUI;
  11. using System.IO;
  12. using System.Drawing;
  13. using System.Timers;
  14.  
  15. namespace Backpack
  16. {
  17.  
  18. public class Backpack : Script
  19. {
  20. ScriptSettings config = ScriptSettings.Load(@"scripts\Backpack\Backpack.ini");
  21. public bool mask;
  22. public bool backpack=true;
  23. public bool holdStrap;
  24. NAudio.Wave.WaveFileReader WavereaderDown;
  25. NAudio.Wave.WaveChannel32 wavechanDown;
  26. NAudio.Wave.DirectSoundOut DSODown;
  27. float volumeDown;
  28.  
  29.  
  30.  
  31. public Backpack()
  32. {
  33. Tick += OnTick;
  34. KeyDown += OnKeyDown;
  35. KeyUp += OnKeyUP;
  36. }
  37. public void SoundFX()
  38. {
  39. if (File.Exists(@"scripts\Backpack\holdStrap.wav"))
  40. {
  41. WavereaderDown = new NAudio.Wave.WaveFileReader(@"scripts\Backpack\holdStrap.wav");
  42. wavechanDown = new NAudio.Wave.WaveChannel32(WavereaderDown);
  43. volumeDown = config.GetValue<float>("Settings", "Global Volume Down", 30f);
  44. DSODown = new NAudio.Wave.DirectSoundOut();
  45. DSODown.Init(wavechanDown);
  46. wavechanDown.Volume = (volumeDown / 100);
  47. DSODown.Play();
  48. DSODown.Dispose();
  49. holdStrap = false;
  50. }
  51. else
  52. {
  53. UI.ShowSubtitle("holdStrap.wav" + " is not found!");
  54. }
  55. }
  56.  
  57. private void OnTick(object sender, EventArgs e)
  58. {
  59. if (backpack == true)
  60. {
  61. int GetHashKey(string value)
  62. {
  63. return Function.Call<int>(Hash.GET_HASH_KEY, value);
  64. }
  65. if (Game.Player.Character.Model.Hash == GetHashKey("PLAYER_ZERO"))
  66. {
  67. float ComponentIDf = config.GetValue<float>("Michael's Backpack", "ComponentID", 10f);
  68. int ComponentID = (int)ComponentIDf;
  69. float Modelf = config.GetValue<float>("Michael's Backpack", "Model", 8f);
  70. int Model = (int)Modelf;
  71. float Texturef = config.GetValue<float>("Michael's Backpack", "Texture", 0f);
  72. int Texture = (int)Texturef;
  73. Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, ComponentID, Model, Texture);
  74. }
  75. if (Game.Player.Character.Model.Hash == GetHashKey("PLAYER_ONE"))
  76. {
  77. float ComponentIDf = config.GetValue<float>("Franklin's Backpack", "ComponentID", 10f);
  78. int ComponentID = (int)ComponentIDf;
  79. float Modelf = config.GetValue<float>("Franklin's Backpack", "Model", 3f);
  80. int Model = (int)Modelf;
  81. float Texturef = config.GetValue<float>("Franklin's Backpack", "Texture", 2f);
  82. int Texture = (int)Texturef;
  83. Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, ComponentID, Model, Texture);
  84. }
  85. if (Game.Player.Character.Model.Hash == GetHashKey("PLAYER_TWO"))
  86. {
  87. float ComponentIDf = config.GetValue<float>("Trevor's Backpack", "ComponentID", 10f);
  88. int ComponentID = (int)ComponentIDf;
  89. float Modelf = config.GetValue<float>("Trevor's Backpack", "Model", 5f);
  90. int Model = (int)Modelf;
  91. float Texturef = config.GetValue<float>("Trevor's Backpack", "Texture", 1f);
  92. int Texture = (int)Texturef;
  93. Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, ComponentID, Model, Texture);
  94.  
  95. }
  96. }
  97. //MASK
  98. if (mask == true)
  99. {
  100. int GetHashKey(string value)
  101. {
  102. return Function.Call<int>(Hash.GET_HASH_KEY, value);
  103. }
  104. if (Game.Player.Character.Model.Hash == GetHashKey("PLAYER_ZERO"))
  105. {
  106. float ComponentIDf = config.GetValue<float>("Michael's Mask", "ComponentID", 1f);
  107. int ComponentID = (int)ComponentIDf;
  108. float Modelf = config.GetValue<float>("Michael's Mask", "Model", 4f);
  109. int Model = (int)Modelf;
  110. float Texturef = config.GetValue<float>("Michael's Mask", "Texture", 0f);
  111. int Texture = (int)Texturef;
  112. Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, ComponentID, Model, Texture);
  113. }
  114. if (Game.Player.Character.Model.Hash == GetHashKey("PLAYER_ONE"))
  115. {
  116. float ComponentIDf = config.GetValue<float>("Franklin's Mask", "ComponentID", 1f);
  117. int ComponentID = (int)ComponentIDf;
  118. float Modelf = config.GetValue<float>("Franklin's Mask", "Model", 4f);
  119. int Model = (int)Modelf;
  120. float Texturef = config.GetValue<float>("Franklin's Mask", "Texture", 0f);
  121. int Texture = (int)Texturef;
  122. Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, ComponentID, Model, Texture);
  123. }
  124. if (Game.Player.Character.Model.Hash == GetHashKey("PLAYER_TWO"))
  125. {
  126. float ComponentIDf = config.GetValue<float>("Trevor's Mask", "ComponentID", 1f);
  127. int ComponentID = (int)ComponentIDf;
  128. float Modelf = config.GetValue<float>("Trevor's Mask", "Model", 2f);
  129. int Model = (int)Modelf;
  130. float Texturef = config.GetValue<float>("Trevor's Mask", "Texture", 0f);
  131. int Texture = (int)Texturef;
  132. Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, ComponentID, Model, Texture);
  133.  
  134. }
  135. }
  136. }
  137. private void OnKeyUP(object sender, KeyEventArgs e)
  138. {
  139.  
  140. }
  141. private void OnKeyDown(object sender, KeyEventArgs e)
  142. {
  143.  
  144. //BAG DRAW ANIM
  145.  
  146. if (e.Shift && Game.IsKeyPressed(Keys.Tab) && !Game.Player.Character.IsInVehicle())
  147. {
  148. Function.Call(Hash.REQUEST_ANIM_DICT, "anim@heists@ornate_bank@grab_cash_heels");
  149. while (!Function.Call<bool>(Hash.HAS_ANIM_DICT_LOADED, "anim@heists@ornate_bank@grab_cash_heels")) Wait(10);
  150. Game.Player.Character.Task.ClearAll();
  151. Function.Call(Hash.TASK_PLAY_ANIM, Game.Player.Character, "anim@heists@ornate_bank@grab_cash_heels", "exit", 24.0f, -12.0, -1, 48, 0f, 0, 0, 0);
  152. Wait(2000);
  153. Game.Player.Character.Task.ClearAll();
  154.  
  155. }
  156.  
  157.  
  158. //BACKPACK
  159.  
  160. if (!Game.Player.Character.IsInVehicle() && e.Shift && Game.IsKeyPressed(config.GetValue<Keys>("KEYS", "Clipset_KEY", Keys.T)) && backpack == true)
  161. {
  162. if (holdStrap == true)
  163. {
  164. Game.Player.Character.Task.ClearAll();
  165. Function.Call(Hash.RESET_PED_WEAPON_MOVEMENT_CLIPSET, Game.Player.Character);
  166. if (File.Exists(@"scripts\Backpack\holdStrap.wav"))
  167. {
  168. WavereaderDown = new NAudio.Wave.WaveFileReader(@"scripts\Backpack\holdStrap.wav");
  169. wavechanDown = new NAudio.Wave.WaveChannel32(WavereaderDown);
  170. volumeDown = config.GetValue<float>("Settings", "Global Volume Down", 30f);
  171. DSODown = new NAudio.Wave.DirectSoundOut();
  172. DSODown.Init(wavechanDown);
  173. wavechanDown.Volume = (volumeDown / 100);
  174. DSODown.Play();
  175. DSODown.Dispose();
  176. holdStrap = false;
  177. } else
  178. {
  179. UI.ShowSubtitle("holdStrap.wav" + " is not found!");
  180. }
  181. } else if (holdStrap == false)
  182. {
  183. Function.Call(Hash.REQUEST_ANIM_SET, "move_p_m_zero_rucksack");
  184. while (!Function.Call<bool>(Hash.HAS_ANIM_SET_LOADED, "move_p_m_zero_rucksack"))
  185. {
  186. Wait(100);
  187. }
  188. if (File.Exists(@"scripts\Backpack\holdStrap.wav"))
  189. {
  190. WavereaderDown = new NAudio.Wave.WaveFileReader(@"scripts\Backpack\holdStrap.wav");
  191. wavechanDown = new NAudio.Wave.WaveChannel32(WavereaderDown);
  192. volumeDown = config.GetValue<float>("Settings", "Global Volume Down", 30f);
  193. DSODown = new NAudio.Wave.DirectSoundOut();
  194. DSODown.Init(wavechanDown);
  195. wavechanDown.Volume = (volumeDown / 100);
  196. DSODown.Play();
  197. DSODown.Dispose();
  198. holdStrap = false;
  199. }
  200. else
  201. {
  202. UI.ShowSubtitle("holdStrap.wav" + " is not found!");
  203. }
  204. Game.Player.Character.Task.ClearAll();
  205. Function.Call(Hash.SET_PED_WEAPON_MOVEMENT_CLIPSET, Game.Player.Character, "move_p_m_zero_rucksack", 1.0f);
  206. holdStrap = true;
  207. }
  208. }
  209. if (e.Shift && Game.IsKeyPressed(config.GetValue<Keys>("KEYS", "Backpack_KEY", Keys.V)))
  210. {
  211. // Function.Call(Hash.DO_SCREEN_FADE_IN,(1000));
  212. // Wait(10);
  213. // Function.Call(Hash.DO_SCREEN_FADE_OUT, (1000));
  214. if (backpack == false)
  215. {
  216. int GetHashKey(string value)
  217. {
  218. return Function.Call<int>(Hash.GET_HASH_KEY, value);
  219. }
  220. if (Game.Player.Character.Model.Hash == GetHashKey("PLAYER_ZERO"))
  221. {
  222. Function.Call(Hash.REQUEST_ANIM_DICT, "oddjobs@basejump@ig_15");
  223. while (!Function.Call<bool>(Hash.HAS_ANIM_DICT_LOADED, "oddjobs@basejump@ig_15")) Wait(10);
  224. Game.Player.Character.Task.ClearAll();
  225. Function.Call(Hash.TASK_PLAY_ANIM, Game.Player.Character, "oddjobs@basejump@ig_15", "puton_parachute", 45.0f, -12.0, -1, 48, 0f, 0, 0, 0);
  226. float ComponentIDf = config.GetValue<float>("Michael's Backpack", "ComponentID", 10f);
  227. int ComponentID = (int)ComponentIDf;
  228. float Modelf = config.GetValue<float>("Michael's Backpack", "Model", 8f);
  229. int Model = (int)Modelf;
  230. float Texturef = config.GetValue<float>("Michael's Backpack", "Texture", 0f);
  231. int Texture = (int)Texturef;
  232. Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, ComponentID, Model, Texture);
  233. Wait(1000);
  234. Game.Player.Character.Task.ClearAll();
  235. }
  236. if (Game.Player.Character.Model.Hash == GetHashKey("PLAYER_ONE"))
  237. {
  238. Function.Call(Hash.REQUEST_ANIM_DICT, "oddjobs@basejump@ig_15");
  239. while (!Function.Call<bool>(Hash.HAS_ANIM_DICT_LOADED, "oddjobs@basejump@ig_15")) Wait(10);
  240. Game.Player.Character.Task.ClearAll();
  241. Function.Call(Hash.TASK_PLAY_ANIM, Game.Player.Character, "oddjobs@basejump@ig_15", "puton_parachute", 45.0f, -12.0, -1, 48, 0f, 0, 0, 0);
  242. float ComponentIDf = config.GetValue<float>("Franklin's Backpack", "ComponentID", 10f);
  243. int ComponentID = (int)ComponentIDf;
  244. float Modelf = config.GetValue<float>("Franklin's Backpack", "Model", 3f);
  245. int Model = (int)Modelf;
  246. float Texturef = config.GetValue<float>("Franklin's Backpack", "Texture", 2f);
  247. int Texture = (int)Texturef;
  248. Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, ComponentID, Model, Texture);
  249. Wait(1000);
  250. Game.Player.Character.Task.ClearAll();
  251. }
  252. if (Game.Player.Character.Model.Hash == GetHashKey("PLAYER_TWO"))
  253. {
  254. Function.Call(Hash.REQUEST_ANIM_DICT, "oddjobs@basejump@ig_15");
  255. while (!Function.Call<bool>(Hash.HAS_ANIM_DICT_LOADED, "oddjobs@basejump@ig_15")) Wait(10);
  256. Game.Player.Character.Task.ClearAll();
  257. Function.Call(Hash.TASK_PLAY_ANIM, Game.Player.Character, "oddjobs@basejump@ig_15", "puton_parachute", 45.0f, -12.0, -1, 48, 0f, 0, 0, 0);
  258. float ComponentIDf = config.GetValue<float>("Trevor's Backpack", "ComponentID", 10f);
  259. int ComponentID = (int)ComponentIDf;
  260. float Modelf = config.GetValue<float>("Trevor's Backpack", "Model", 5f);
  261. int Model = (int)Modelf;
  262. float Texturef = config.GetValue<float>("Trevor's Backpack", "Texture", 1f);
  263. int Texture = (int)Texturef;
  264. Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, ComponentID, Model, Texture);
  265. Wait(1000);
  266. Game.Player.Character.Task.ClearAll();
  267.  
  268. }
  269. backpack = true;
  270. holdStrap = true;
  271. UI.Notify("Backpack set");
  272. Function.Call(Hash.REQUEST_ANIM_SET, "move_p_m_zero_rucksack");
  273. while (!Function.Call<bool>(Hash.HAS_ANIM_SET_LOADED, "move_p_m_zero_rucksack"))
  274. {
  275. Wait(100);
  276. }
  277. Function.Call(Hash.SET_PED_WEAPON_MOVEMENT_CLIPSET, Game.Player.Character, "move_p_m_zero_rucksack", 1.0f);
  278. }
  279. else if (backpack == true)
  280. {
  281. int GetHashKey(string value)
  282. {
  283. return Function.Call<int>(Hash.GET_HASH_KEY, value);
  284. }
  285. if (Game.Player.Character.Model.Hash == GetHashKey("PLAYER_ZERO"))
  286. {
  287. Function.Call(Hash.REQUEST_ANIM_DICT, "skydive@parachute@");
  288. while (!Function.Call<bool>(Hash.HAS_ANIM_DICT_LOADED, "skydive@parachute@")) Wait(10);
  289. Game.Player.Character.Task.ClearAll();
  290. Function.Call(Hash.TASK_PLAY_ANIM, Game.Player.Character, "skydive@parachute@", "chute_off", 12.0f, -12.0, -1, 48, 0f, 0, 0, 0);
  291. Wait(500);
  292. Game.Player.Character.Task.ClearAll();
  293. float ComponentIDf = config.GetValue<float>("Michael's Backpack", "OFFComponentID", 10f);
  294. int ComponentID = (int)ComponentIDf;
  295. float Modelf = config.GetValue<float>("Michael's Backpack", "OFFModel", 0f);
  296. int Model = (int)Modelf;
  297. float Texturef = config.GetValue<float>("Michael's Backpack", "OFFTexture", 0f);
  298. int Texture = (int)Texturef;
  299. Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, ComponentID, Model, Texture);
  300.  
  301. }
  302. if (Game.Player.Character.Model.Hash == GetHashKey("PLAYER_ONE"))
  303. {
  304. Function.Call(Hash.REQUEST_ANIM_DICT, "skydive@parachute@");
  305. while (!Function.Call<bool>(Hash.HAS_ANIM_DICT_LOADED, "skydive@parachute@")) Wait(10);
  306. Game.Player.Character.Task.ClearAll();
  307. Function.Call(Hash.TASK_PLAY_ANIM, Game.Player.Character, "skydive@parachute@", "chute_off", 12.0f, -12.0, -1, 48, 0f, 0, 0, 0);
  308. Wait(500);
  309. Game.Player.Character.Task.ClearAll();
  310. float ComponentIDf = config.GetValue<float>("Franklin's Backpack", "OFFComponentID", 10f);
  311. int ComponentID = (int)ComponentIDf;
  312. float Modelf = config.GetValue<float>("Franklin's Backpack", "OFFModel", 0f);
  313. int Model = (int)Modelf;
  314. float Texturef = config.GetValue<float>("Franklin's Backpack", "OFFTexture", 0f);
  315. int Texture = (int)Texturef;
  316. Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, ComponentID, Model, Texture);
  317. }
  318. if (Game.Player.Character.Model.Hash == GetHashKey("PLAYER_TWO"))
  319. {
  320. Function.Call(Hash.REQUEST_ANIM_DICT, "skydive@parachute@");
  321. while (!Function.Call<bool>(Hash.HAS_ANIM_DICT_LOADED, "skydive@parachute@")) Wait(10);
  322. Game.Player.Character.Task.ClearAll();
  323. Function.Call(Hash.TASK_PLAY_ANIM, Game.Player.Character, "skydive@parachute@", "chute_off", 12.0f, -12.0, -1, 48, 0f, 0, 0, 0);
  324. Wait(500);
  325. Game.Player.Character.Task.ClearAll();
  326. float ComponentIDf = config.GetValue<float>("Trevor's Backpack", "OFFComponentID", 10f);
  327. int ComponentID = (int)ComponentIDf;
  328. float Modelf = config.GetValue<float>("Trevor's Backpack", "OFFModel", 0f);
  329. int Model = (int)Modelf;
  330. float Texturef = config.GetValue<float>("Trevor's Backpack", "OFFTexture", 0f);
  331. int Texture = (int)Texturef;
  332. Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, ComponentID, Model, Texture);
  333.  
  334. }
  335. backpack = false;
  336. UI.Notify("Backpack unset");
  337. Function.Call(Hash.RESET_PED_WEAPON_MOVEMENT_CLIPSET, Game.Player.Character);
  338. }
  339.  
  340. }
  341. //MASK
  342. if (e.Shift && Game.IsKeyPressed(config.GetValue<Keys>("KEYS", "Mask_KEY", Keys.N)))
  343. {
  344. // Function.Call(Hash.DO_SCREEN_FADE_IN,(1000));
  345. // Wait(10);
  346. // Function.Call(Hash.DO_SCREEN_FADE_OUT, (1000));
  347. if (mask == false)
  348. {
  349. int GetHashKey(string value)
  350. {
  351. return Function.Call<int>(Hash.GET_HASH_KEY, value);
  352. }
  353. if (Game.Player.Character.Model.Hash == GetHashKey("PLAYER_ZERO"))
  354. {
  355. Function.Call(Hash.REQUEST_ANIM_DICT, "mp_masks@on_foot");
  356. while (!Function.Call<bool>(Hash.HAS_ANIM_DICT_LOADED, "mp_masks@on_foot")) Wait(10);
  357. Game.Player.Character.Task.ClearAll();
  358. Function.Call(Hash.TASK_PLAY_ANIM, Game.Player.Character, "mp_masks@on_foot", "put_on_mask", 8.0f, -12.0, -1, 48, 0f, 0, 0, 0);
  359. float ComponentIDf = config.GetValue<float>("Michael's Mask", "ComponentID", 1f);
  360. int ComponentID = (int)ComponentIDf;
  361. float Modelf = config.GetValue<float>("Michael's Mask", "Model", 4f);
  362. int Model = (int)Modelf;
  363. float Texturef = config.GetValue<float>("Michael's Mask", "Texture", 0f);
  364. int Texture = (int)Texturef;
  365. Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, ComponentID, Model, Texture);
  366. SoundFX();
  367. }
  368. if (Game.Player.Character.Model.Hash == GetHashKey("PLAYER_ONE"))
  369. {
  370. Function.Call(Hash.REQUEST_ANIM_DICT, "mp_masks@on_foot");
  371. while (!Function.Call<bool>(Hash.HAS_ANIM_DICT_LOADED, "mp_masks@on_foot")) Wait(10);
  372. Game.Player.Character.Task.ClearAll();
  373. Function.Call(Hash.TASK_PLAY_ANIM, Game.Player.Character, "mp_masks@on_foot", "put_on_mask", 8.0f, -12.0, -1, 48, 0f, 0, 0, 0);
  374. float ComponentIDf = config.GetValue<float>("Franklin's Mask", "ComponentID", 1f);
  375. int ComponentID = (int)ComponentIDf;
  376. float Modelf = config.GetValue<float>("Franklin's Mask", "Model", 4f);
  377. int Model = (int)Modelf;
  378. float Texturef = config.GetValue<float>("Franklin's Mask", "Texture", 0f);
  379. int Texture = (int)Texturef;
  380. Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, ComponentID, Model, Texture);
  381. SoundFX();
  382. }
  383. if (Game.Player.Character.Model.Hash == GetHashKey("PLAYER_TWO"))
  384. {
  385. Function.Call(Hash.REQUEST_ANIM_DICT, "mp_masks@on_foot");
  386. while (!Function.Call<bool>(Hash.HAS_ANIM_DICT_LOADED, "mp_masks@on_foot")) Wait(10);
  387. Game.Player.Character.Task.ClearAll();
  388. Function.Call(Hash.TASK_PLAY_ANIM, Game.Player.Character, "mp_masks@on_foot", "put_on_mask", 8.0f, -12.0, -1, 48, 0f, 0, 0, 0);
  389. float ComponentIDf = config.GetValue<float>("Trevor's Mask", "ComponentID", 1f);
  390. int ComponentID = (int)ComponentIDf;
  391. float Modelf = config.GetValue<float>("Trevor's Mask", "Model", 2f);
  392. int Model = (int)Modelf;
  393. float Texturef = config.GetValue<float>("Trevor's Mask", "Texture", 0f);
  394. int Texture = (int)Texturef;
  395. Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, ComponentID, Model, Texture);
  396. SoundFX();
  397.  
  398. }
  399. mask = true;
  400. UI.Notify("Mask set");
  401. }
  402. else if (mask == true)
  403. {
  404. int GetHashKey(string value)
  405. {
  406. return Function.Call<int>(Hash.GET_HASH_KEY, value);
  407. }
  408. if (Game.Player.Character.Model.Hash == GetHashKey("PLAYER_ZERO"))
  409. {
  410. Function.Call(Hash.REQUEST_ANIM_DICT, "mp_masks@on_foot");
  411. while (!Function.Call<bool>(Hash.HAS_ANIM_DICT_LOADED, "mp_masks@on_foot")) Wait(10);
  412. Game.Player.Character.Task.ClearAll();
  413. Function.Call(Hash.TASK_PLAY_ANIM, Game.Player.Character, "mp_masks@on_foot", "put_on_mask", 8.0f, -12.0, -1, 48, 0f, 0, 0, 0);
  414. float ComponentIDf = config.GetValue<float>("Michael's Mask", "OFFComponentID", 1f);
  415. int ComponentID = (int)ComponentIDf;
  416. float Modelf = config.GetValue<float>("Michael's Mask", "OFFModel", 2f);
  417. int Model = (int)Modelf;
  418. float Texturef = config.GetValue<float>("Michael's Mask", "OFFTexture", 0f);
  419. int Texture = (int)Texturef;
  420. Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, ComponentID, Model, Texture);
  421. SoundFX();
  422. }
  423. if (Game.Player.Character.Model.Hash == GetHashKey("PLAYER_ONE"))
  424. {
  425. Function.Call(Hash.REQUEST_ANIM_DICT, "mp_masks@on_foot");
  426. while (!Function.Call<bool>(Hash.HAS_ANIM_DICT_LOADED, "mp_masks@on_foot")) Wait(10);
  427. Game.Player.Character.Task.ClearAll();
  428. Function.Call(Hash.TASK_PLAY_ANIM, Game.Player.Character, "mp_masks@on_foot", "put_on_mask", 8.0f, -12.0, -1, 48, 0f, 0, 0, 0);
  429. float ComponentIDf = config.GetValue<float>("Franklin's Mask", "OFFComponentID", 1f);
  430. int ComponentID = (int)ComponentIDf;
  431. float Modelf = config.GetValue<float>("Franklin's Mask", "OFFModel", 1f);
  432. int Model = (int)Modelf;
  433. float Texturef = config.GetValue<float>("Franklin's Mask", "OFFTexture", 0f);
  434. int Texture = (int)Texturef;
  435. Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, ComponentID, Model, Texture);
  436. SoundFX();
  437. }
  438. if (Game.Player.Character.Model.Hash == GetHashKey("PLAYER_TWO"))
  439. {
  440. Function.Call(Hash.REQUEST_ANIM_DICT, "mp_masks@on_foot");
  441. while (!Function.Call<bool>(Hash.HAS_ANIM_DICT_LOADED, "mp_masks@on_foot")) Wait(10);
  442. Game.Player.Character.Task.ClearAll();
  443. Function.Call(Hash.TASK_PLAY_ANIM, Game.Player.Character, "mp_masks@on_foot", "put_on_mask", 8.0f, -12.0, -1, 48, 0f, 0, 0, 0);
  444. float ComponentIDf = config.GetValue<float>("Trevor's Mask", "OFFComponentID", 1f);
  445. int ComponentID = (int)ComponentIDf;
  446. float Modelf = config.GetValue<float>("Trevor's Mask", "OFFModel", 0f);
  447. int Model = (int)Modelf;
  448. float Texturef = config.GetValue<float>("Trevor's Mask", "OFFTexture", 0f);
  449. int Texture = (int)Texturef;
  450. Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, ComponentID, Model, Texture);
  451. SoundFX();
  452.  
  453. }
  454. mask = false;
  455. UI.Notify("Mask unset");
  456. }
  457.  
  458. }
  459. }
  460. }
  461. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement