Advertisement
Guest User

client.lua

a guest
Jun 4th, 2017
864
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.45 KB | None | 0 0
  1. emotes = {
  2. ["/cop"] = { cmd = '/cop', event = 'playCopEmote' }, -- Get New Emotes From http://gtaforums.com/topic/796181-list-of-scenarios-for-peds/
  3. ["/sit"] = { cmd = '/sit', event = 'playSitEmote' },
  4. ["/chair"] = { cmd = '/chair', event = 'playChairEmote' },
  5. ["/kneel"] = { cmd = '/kneel', event = 'playKneelEmote' },
  6. ["/sunbathe"] = { cmd = '/sunbathe', event = 'playSunbatheEmote' },
  7. ["/sunbatheback"] = { cmd = '/sunbatheback', event = 'playSunbathebackEmote' },
  8. ["/notepad"] = { cmd = '/notepad', event = 'playNotepadEmote' },
  9. ["/cameraphone"] = { cmd = '/cameraphone', event = 'playCameraphoneEmote' },
  10. ["/traffic"] = { cmd = '/traffic', event = 'playTrafficEmote' },
  11. ["/photo"] = { cmd = '/photo', event = 'playPhotoEmote' },
  12. ["/clipboard"] = { cmd = '/clipboard', event = 'playClipboardEmote' },
  13. ["/lean"] = { cmd = '/lean', event = 'playLeanEmote' },
  14. ["/smoke"] = { cmd = '/smoke', event = 'playSmokeEmote' },
  15. ["/drink"] = { cmd = '/drink', event = 'playDrinkEmote' },
  16. ["/partying"] = { cmd = '/partying', event = 'playPartyingEmote' },
  17. ["/cheer"] = { cmd = '/cheer', event = 'playCheerEmote' },
  18. ["/binoculars"] = { cmd = '/binoculars', event = 'playBinocularsEmote' },
  19. ["/constructiondrill"] = { cmd = '/condrill', event = 'playConstructiondrillEmote' },
  20. ["/welding"] = { cmd = '/welding', event = 'playWeldingEmote' },
  21. ["/mechanic"] = { cmd = '/mechanic', event = 'playMechanicEmote' },
  22. ["/smokepot"] = { cmd = '/smokepot', event = 'playSmokepotEmote' },
  23. ["/yoga"] = { cmd = '/yoga', event = 'playYogaEmote' },
  24. ["/musician"] = { cmd = '/musician', event = 'playMusicianEmote' },
  25. ["/pushups"] = { cmd = '/pushups', event = 'playPushupsEmote' },
  26. ["/muscleflex"] = { cmd = '/muscleflex', event = 'playMuscleflexEmote' },
  27. ["/situps"] = { cmd = '/situps', event = 'playSitupsEmote' },
  28. ["/chinups"] = { cmd = '/chinups', event = 'playChinupsEmote' },
  29. ["/torch"] = { cmd = '/torch', event = 'playTorchEmote' },
  30. ["/cancelemote"] = { cmd = '/cancelemote', event = 'playCancelEmote' }
  31. }
  32.  
  33. --RegisterNetEvent('printInvalidEmote');
  34. RegisterNetEvent('printEmoteList');
  35. RegisterNetEvent('playCopEmote');
  36. RegisterNetEvent('playSitEmote');
  37. RegisterNetEvent('playChairEmote');
  38. RegisterNetEvent('playKneelEmote');
  39. RegisterNetEvent('playSunbatheEmote');
  40. RegisterNetEvent('playSunbathebackEmote');
  41. RegisterNetEvent('playNotepadEmote');
  42. RegisterNetEvent('playCameraphoneEmote');
  43. RegisterNetEvent('playTrafficEmote');
  44. RegisterNetEvent('playPhotoEmote');
  45. RegisterNetEvent('playClipboardEmote');
  46. RegisterNetEvent('playLeanEmote');
  47. RegisterNetEvent('playSmokeEmote');
  48. RegisterNetEvent('playDrinkEmote');
  49. RegisterNetEvent('playPartyingEmote');
  50. RegisterNetEvent('playCheerEmote');
  51. RegisterNetEvent('playBinocularsEmote');
  52. RegisterNetEvent('playConstructiondrillEmote');
  53. RegisterNetEvent('playWeldingEmote');
  54. RegisterNetEvent('playMechanicEmote');
  55. RegisterNetEvent('playSmokepotEmote');
  56. RegisterNetEvent('playYogaEmote');
  57. RegisterNetEvent('playMusicianEmote');
  58. RegisterNetEvent('playPushupsEmote');
  59. RegisterNetEvent('playMuscleflexEmote');
  60. RegisterNetEvent('playSitupsEmote');
  61. RegisterNetEvent('playChinupsEmote');
  62. RegisterNetEvent('playTorchEmote');
  63. RegisterNetEvent('playCancelEmote');
  64.  
  65. playing_emote = false;
  66.  
  67. --[[
  68. playing_cop_emote = false;
  69. playing_sit_emote = false;
  70. playing_chair_emote = false;
  71. playing_kneel_emote = false;
  72. playing_medic_emote = false;
  73. playing_notepad_emote = false;
  74. playing_traffic_emote = false;
  75. playing_photo_emote = false;
  76. playing_clipboard_emote = false;
  77. playing_lean_emote = false;
  78. playing_smoke_emote = false;
  79. playing_drink_emote = false;
  80. ]]--
  81.  
  82. AddEventHandler('printEmoteList', function()
  83. TriggerEvent('chatMessage', "^4ALERT", {255, 0, 0}, "^2Emote List: ^0cop, sit, chair, kneel, medic, notepad, traffic, photo, clipboard, lean, smoke, drink, sunbathe, partying, cheer, binoculars, constructiondrill, cameraphone, smokepot, yoga, pushups, situps, muscleflex, sunbatheback, chinups, torch, welding, mechanic, musician");
  84. end)
  85.  
  86. --AddEventHandler('printInvalidEmote', function()
  87. -- TriggerEvent('chatMessage', "^4ALERT", {255, 0, 0}, "^1Invalid emote specified, use /emotes");
  88. --end)
  89.  
  90. --!!!DO NOT EDIT BELOW THIS LINE!!!
  91.  
  92. AddEventHandler('playSmokeEmote', function()
  93. ped = GetPlayerPed(-1);
  94.  
  95. if ped then
  96. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_SMOKING", 0, true);
  97. playing_emote = true;
  98. end
  99.  
  100. Menu.hidden = true
  101. end)
  102.  
  103. AddEventHandler('playDrinkEmote', function()
  104. ped = GetPlayerPed(-1);
  105.  
  106. if ped then
  107. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_DRINKING", 0, true);
  108. playing_emote = true;
  109. end
  110.  
  111. Menu.hidden = true
  112. end)
  113.  
  114. AddEventHandler('playCopEmote', function()
  115. ped = GetPlayerPed(-1);
  116.  
  117. if ped then
  118. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_COP_IDLES", 0, true);
  119. playing_emote = true;
  120. end
  121.  
  122. Menu.hidden = true
  123. end)
  124.  
  125. AddEventHandler('playSitEmote', function()
  126. ped = GetPlayerPed(-1);
  127.  
  128. if ped then
  129. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_PICNIC", 0, true);
  130. playing_emote = true;
  131. end
  132.  
  133. Menu.hidden = true
  134. end)
  135.  
  136. AddEventHandler('playChairEmote', function()
  137. ped = GetPlayerPed(-1);
  138.  
  139. if ped then
  140. pos = GetEntityCoords(ped);
  141. head = GetEntityHeading(ped);
  142. TaskStartScenarioAtPosition(ped, "PROP_HUMAN_SEAT_CHAIR", pos['x'], pos['y'], pos['z'] - 1, head, 0, 0, 1);
  143. --TaskStartScenarioInPlace(ped, "PROP_HUMAN_SEAT_CHAIR", 0, false);
  144. playing_emote = true;
  145. end
  146.  
  147. Menu.hidden = true
  148. end)
  149.  
  150. AddEventHandler('playKneelEmote', function()
  151. ped = GetPlayerPed(-1);
  152.  
  153. if ped then
  154. TaskStartScenarioInPlace(ped, "CODE_HUMAN_MEDIC_KNEEL", 0, true);
  155. playing_emote = true;
  156. end
  157.  
  158. Menu.hidden = true
  159. end)
  160.  
  161. AddEventHandler('playSunbatheEmote', function()
  162. ped = GetPlayerPed(-1);
  163.  
  164. if ped then
  165. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_SUNBATHE", 0, true);
  166. playing_emote = true;
  167. end
  168.  
  169. Menu.hidden = true
  170. end)
  171.  
  172. AddEventHandler('playSunbathebackEmote', function()
  173. ped = GetPlayerPed(-1);
  174.  
  175. if ped then
  176. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_SUNBATHE_BACK", 0, true);
  177. playing_emote = true;
  178. end
  179.  
  180. Menu.hidden = true
  181. end)
  182.  
  183. AddEventHandler('playNotepadEmote', function()
  184. ped = GetPlayerPed(-1);
  185.  
  186. if ped then
  187. TaskStartScenarioInPlace(ped, "CODE_HUMAN_MEDIC_TIME_OF_DEATH", 0, true);
  188. playing_emote = true;
  189. end
  190.  
  191. Menu.hidden = true
  192. end)
  193.  
  194. AddEventHandler('playTrafficEmote', function()
  195. ped = GetPlayerPed(-1);
  196.  
  197. if ped then
  198. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_CAR_PARK_ATTENDANT", 0, false);
  199. playing_emote = true;
  200. end
  201.  
  202. Menu.hidden = true
  203. end)
  204.  
  205. AddEventHandler('playPhotoEmote', function()
  206. ped = GetPlayerPed(-1);
  207.  
  208. if ped then
  209. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_PAPARAZZI", 0, false);
  210. playing_emote = true;
  211. end
  212.  
  213. Menu.hidden = true
  214. end)
  215.  
  216. AddEventHandler('playClipboardEmote', function()
  217. ped = GetPlayerPed(-1);
  218.  
  219. if ped then
  220. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_CLIPBOARD", 0, false);
  221. playing_emote = true;
  222. end
  223.  
  224. Menu.hidden = true
  225. end)
  226.  
  227. AddEventHandler('playLeanEmote', function()
  228. ped = GetPlayerPed(-1);
  229.  
  230. if ped then
  231. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_LEANING", 0, true);
  232. playing_emote = true;
  233. end
  234.  
  235. Menu.hidden = true
  236. end)
  237.  
  238. AddEventHandler('playCheerEmote', function()
  239. ped = GetPlayerPed(-1);
  240.  
  241. if ped then
  242. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_CHEERING", 0, true);
  243. playing_emote = true;
  244. end
  245.  
  246. Menu.hidden = true
  247. end)
  248.  
  249. AddEventHandler('playBinocularsEmote', function()
  250. ped = GetPlayerPed(-1);
  251.  
  252. if ped then
  253. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_BINOCULARS", 0, true);
  254. playing_emote = true;
  255. end
  256.  
  257. Menu.hidden = true
  258. end)
  259.  
  260. AddEventHandler('playConstructiondrillEmote', function()
  261. ped = GetPlayerPed(-1);
  262.  
  263. if ped then
  264. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_CONST_DRILL", 0, true);
  265. playing_emote = true;
  266. end
  267.  
  268. Menu.hidden = true
  269. end)
  270.  
  271. AddEventHandler('playCameraphoneEmote', function()
  272. ped = GetPlayerPed(-1);
  273.  
  274. if ped then
  275. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_MOBILE_FILM_SHOCKING", 0, true);
  276. playing_emote = true;
  277. end
  278.  
  279. Menu.hidden = true
  280. end)
  281.  
  282. AddEventHandler('playSmokepotEmote', function()
  283. ped = GetPlayerPed(-1);
  284.  
  285. if ped then
  286. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_SMOKING_POT", 0, true);
  287. playing_emote = true;
  288. end
  289.  
  290. Menu.hidden = true
  291. end)
  292.  
  293. AddEventHandler('playYogaEmote', function()
  294. ped = GetPlayerPed(-1);
  295.  
  296. if ped then
  297. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_YOGA", 0, true);
  298. playing_emote = true;
  299. end
  300.  
  301. Menu.hidden = true
  302. end)
  303.  
  304. AddEventHandler('playMusicianEmote', function()
  305. ped = GetPlayerPed(-1);
  306.  
  307. if ped then
  308. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_MUSICIAN", 0, true);
  309. playing_emote = true;
  310. end
  311.  
  312. Menu.hidden = true
  313. end)
  314.  
  315. AddEventHandler('playPushupsEmote', function()
  316. ped = GetPlayerPed(-1);
  317.  
  318. if ped then
  319. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_PUSH_UPS", 0, true);
  320. playing_emote = true;
  321. end
  322.  
  323. Menu.hidden = true
  324. end)
  325.  
  326. AddEventHandler('playSitupsEmote', function()
  327. ped = GetPlayerPed(-1);
  328.  
  329. if ped then
  330. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_SIT_UPS", 0, true);
  331. playing_emote = true;
  332. end
  333.  
  334. Menu.hidden = true
  335. end)
  336.  
  337. AddEventHandler('playMuscleflexEmote', function()
  338. ped = GetPlayerPed(-1);
  339.  
  340. if ped then
  341. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_MUSCLE_FLEX", 0, true);
  342. playing_emote = true;
  343. end
  344.  
  345. Menu.hidden = true
  346. end)
  347.  
  348. AddEventHandler('playPartyingEmote', function()
  349. ped = GetPlayerPed(-1);
  350.  
  351. if ped then
  352. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_PARTYING", 0, true);
  353. playing_emote = true;
  354. end
  355.  
  356. Menu.hidden = true
  357. end)
  358.  
  359. AddEventHandler('playTorchEmote', function()
  360. ped = GetPlayerPed(-1);
  361.  
  362. if ped then
  363. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_SECURITY_SHINE_TORCH", 0, true);
  364. playing_emote = true;
  365. end
  366.  
  367. Menu.hidden = true
  368. end)
  369.  
  370. AddEventHandler('playChinupsEmote', function()
  371. ped = GetPlayerPed(-1);
  372.  
  373. if ped then
  374. TaskStartScenarioInPlace(ped, "PROP_HUMAN_MUSCLE_CHIN_UPS", 0, true);
  375. playing_emote = true;
  376. end
  377.  
  378. Menu.hidden = true
  379. end)
  380.  
  381. AddEventHandler('playWeldingEmote', function()
  382. ped = GetPlayerPed(-1);
  383.  
  384. if ped then
  385. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_WELDING", 0, true);
  386. playing_emote = true;
  387. end
  388.  
  389. Menu.hidden = true
  390. end)
  391.  
  392. AddEventHandler('playMechanicEmote', function()
  393. ped = GetPlayerPed(-1);
  394.  
  395. if ped then
  396. TaskStartScenarioInPlace(ped, "WORLD_HUMAN_VEHICLE_MECHANIC", 0, true);
  397. playing_emote = true;
  398. end
  399.  
  400. Menu.hidden = true
  401. end)
  402.  
  403. AddEventHandler('playCancelEmote', function()
  404. ped = GetPlayerPed(-1);
  405.  
  406. if ped then
  407. ClearPedTasks(ped);
  408. playing_emote = false
  409. end
  410.  
  411. Menu.hidden = true
  412. end)
  413.  
  414. function InitMenu() -- How They Appear On The GUI
  415. ClearMenu()
  416. Menu.addTitle("Emotes");
  417. Menu.addButton("Lean", "TriggerEvent", emotes["/lean"].event)
  418. Menu.addButton("Kneel", "TriggerEvent", emotes["/kneel"].event)
  419. Menu.addButton("Smoke", "TriggerEvent", emotes["/smoke"].event)
  420. Menu.addButton("Smoke Pot", "TriggerEvent", emotes["/smokepot"].event)
  421. Menu.addButton("Drink", "TriggerEvent", emotes["/drink"].event)
  422. Menu.addButton("Partying", "TriggerEvent", emotes["/partying"].event)
  423. Menu.addButton("Cheer", "TriggerEvent", emotes["/cheer"].event)
  424. Menu.addButton("Chin Ups", "TriggerEvent", emotes["/chinups"].event)
  425. Menu.addButton("Push Ups", "TriggerEvent", emotes["/pushups"].event)
  426. Menu.addButton("Sit ups", "TriggerEvent", emotes["/situps"].event)
  427. Menu.addButton("Flex", "TriggerEvent", emotes["/muscleflex"].event)
  428. Menu.addButton("Yoga", "TriggerEvent", emotes["/yoga"].event)
  429. Menu.addButton("Sunbathe", "TriggerEvent", emotes["/sunbathe"].event)
  430. Menu.addButton("Sunbathe(back)", "TriggerEvent", emotes["/sunbatheback"].event)
  431. Menu.addButton("Sit", "TriggerEvent", emotes["/sit"].event)
  432. Menu.addButton("Chair", "TriggerEvent", emotes["/chair"].event)
  433. Menu.addButton("Notepad", "TriggerEvent", emotes["/notepad"].event)
  434. Menu.addButton("Clipboard", "TriggerEvent", emotes["/clipboard"].event)
  435. Menu.addButton("Camera Phone", "TriggerEvent", emotes["/cameraphone"].event)
  436. Menu.addButton("Photographer", "TriggerEvent", emotes["/photo"].event)
  437. Menu.addButton("Drums", "TriggerEvent", emotes["/musician"].event)
  438. Menu.addButton("Binoculars", "TriggerEvent", emotes["/binoculars"].event)
  439. Menu.addButton("Cop", "TriggerEvent", emotes["/cop"].event)
  440. Menu.addButton("Torch", "TriggerEvent", emotes["/torch"].event)
  441. Menu.addButton("Traffic", "TriggerEvent", emotes["/traffic"].event)
  442. Menu.addButton("Drill", "TriggerEvent", emotes["/constructiondrill"].event)
  443. Menu.addButton("Welding", "TriggerEvent", emotes["/welding"].event)
  444. Menu.addButton("Mechanic", "TriggerEvent", emotes["/mechanic"].event)
  445. -- Menu.addButton("Cancel emote", "TriggerEvent", emotes["/cancelemote"].event)
  446. end
  447.  
  448. -- Check if player is in a vehicle
  449. function IsInVehicle()
  450. local ply = GetPlayerPed(-1)
  451. if IsPedSittingInAnyVehicle(ply) then
  452. return false
  453. else
  454. return true
  455. end
  456. end
  457.  
  458. function Isfdead()
  459. local ply = GetPlayerPed(-1)
  460. if IsPedDeadOrDying(ply) then
  461. return false
  462. else
  463. return true
  464. end
  465. end
  466.  
  467.  
  468. Citizen.CreateThread(function()
  469. while true do
  470. Citizen.Wait(0)
  471. if (Isfdead()) then
  472. if (IsInVehicle()) then
  473. if IsControlJustPressed(1, 19) then -- Left ALT
  474. InitMenu()
  475. Menu.hidden = not Menu.hidden
  476. elseif IsControlJustPressed(1, 32) then -- INPUT_MOVE_UP_ONLY
  477. ClearPedTasks(ped);
  478. playing_emote = false
  479. end
  480. end
  481. end
  482. Menu.renderGUI()
  483. end
  484. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement