· 5 years ago · May 21, 2020, 07:20 PM
1Skip to content
2Why GitHub?
3Team
4Enterprise
5Explore
6Marketplace
7Pricing
8Search
9
10Sign in
11Sign up
12XxFri3ndlyxX
13/
14esx_illegal_drugs
156710
16 Code
17 Pull requests 0 Actions
18 Projects 0
19 Security 0
20 Insights
21Join GitHub today
22GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
23
24esx_illegal_drugs/client/esx_illegal_drugs_cl.lua
25@XxFri3ndlyxX XxFri3ndlyxX Update esx_illegal_drugs_cl.lua
26125be67 on Mar 31 2019
27551 lines (497 sloc) 19.5 KB
28
29local Keys = {
30 ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57,
31 ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177,
32 ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18,
33 ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182,
34 ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81,
35 ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70,
36 ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178,
37 ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173,
38 ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118
39}
40
41local cokeQTE = 0
42ESX = nil
43local coke_poochQTE = 0
44local weedQTE = 0
45local weed_poochQTE = 0
46local methQTE = 0
47local meth_poochQTE = 0
48local opiumQTE = 0
49local opium_poochQTE = 0
50local myJob = nil
51local HasAlreadyEnteredMarker = false
52local LastZone = nil
53local isInZone = false
54local CurrentAction = nil
55local CurrentActionMsg = ''
56local CurrentActionData = {}
57
58Citizen.CreateThread(function()
59 while ESX == nil do
60 TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
61 Citizen.Wait(0)
62 end
63end)
64
65AddEventHandler('esx_illegal_drugs:hasEnteredMarker', function(zone)
66 if myJob == 'police' or myJob == 'ambulance' then
67 return
68 end
69
70 ESX.UI.Menu.CloseAll()
71
72 if zone == 'exitMarker' then
73 CurrentAction = zone
74 CurrentActionMsg = _U('exit_marker')
75 CurrentActionData = {}
76 end
77
78 if zone == 'CokeField' then
79 CurrentAction = zone
80 CurrentActionMsg = _U('press_collect_coke')
81 CurrentActionData = {}
82 end
83
84 if zone == 'CokeProcessing' then
85 if cokeQTE >= 5 then
86 CurrentAction = zone
87 CurrentActionMsg = _U('press_process_coke')
88 CurrentActionData = {}
89 end
90 end
91
92 if zone == 'CokeDealer' then
93 if coke_poochQTE >= 1 then
94 CurrentAction = zone
95 CurrentActionMsg = _U('press_sell_coke')
96 CurrentActionData = {}
97 end
98 end
99
100 if zone == 'MethField' then
101 CurrentAction = zone
102 CurrentActionMsg = _U('press_collect_meth')
103 CurrentActionData = {}
104 end
105
106 if zone == 'MethProcessing' then
107 if methQTE >= 5 then
108 CurrentAction = zone
109 CurrentActionMsg = _U('press_process_meth')
110 CurrentActionData = {}
111 end
112 end
113
114 if zone == 'MethDealer' then
115 if meth_poochQTE >= 1 then
116 CurrentAction = zone
117 CurrentActionMsg = _U('press_sell_meth')
118 CurrentActionData = {}
119 end
120 end
121
122 if zone == 'WeedField' then
123 CurrentAction = zone
124 CurrentActionMsg = _U('press_collect_weed')
125 CurrentActionData = {}
126 end
127
128 if zone == 'WeedProcessing' then
129 if weedQTE >= 5 then
130 CurrentAction = zone
131 CurrentActionMsg = _U('press_process_weed')
132 CurrentActionData = {}
133 end
134 end
135
136 if zone == 'WeedDealer' then
137 if weed_poochQTE >= 1 then
138 CurrentAction = zone
139 CurrentActionMsg = _U('press_sell_weed')
140 CurrentActionData = {}
141 end
142 end
143
144 if zone == 'OpiumField' then
145 CurrentAction = zone
146 CurrentActionMsg = _U('press_collect_opium')
147 CurrentActionData = {}
148 end
149
150 if zone == 'OpiumProcessing' then
151 if opiumQTE >= 5 then
152 CurrentAction = zone
153 CurrentActionMsg = _U('press_process_opium')
154 CurrentActionData = {}
155 end
156 end
157
158 if zone == 'OpiumDealer' then
159 if opium_poochQTE >= 1 then
160 CurrentAction = zone
161 CurrentActionMsg = _U('press_sell_opium')
162 CurrentActionData = {}
163 end
164 end
165end)
166
167
168AddEventHandler('esx_illegal_drugs:hasExitedMarker', function(zone)
169 CurrentAction = nil
170 ESX.UI.Menu.CloseAll()
171
172 TriggerServerEvent('esx_illegal_drugs:stopHarvestCoke')
173 TriggerServerEvent('esx_illegal_drugs:stopTransformCoke')
174 TriggerServerEvent('esx_illegal_drugs:stopSellCoke')
175 TriggerServerEvent('esx_illegal_drugs:stopHarvestMeth')
176 TriggerServerEvent('esx_illegal_drugs:stopTransformMeth')
177 TriggerServerEvent('esx_illegal_drugs:stopSellMeth')
178 TriggerServerEvent('esx_illegal_drugs:stopHarvestWeed')
179 TriggerServerEvent('esx_illegal_drugs:stopTransformWeed')
180 TriggerServerEvent('esx_illegal_drugs:stopSellWeed')
181 TriggerServerEvent('esx_illegal_drugs:stopHarvestOpium')
182 TriggerServerEvent('esx_illegal_drugs:stopTransformOpium')
183 TriggerServerEvent('esx_illegal_drugs:stopSellOpium')
184end)
185
186
187-- Weed Effect
188RegisterNetEvent('esx_illegal_drugs:onPot')
189AddEventHandler('esx_illegal_drugs:onPot', function()
190 RequestAnimSet("MOVE_M@DRUNK@SLIGHTLYDRUNK")
191 while not HasAnimSetLoaded("MOVE_M@DRUNK@SLIGHTLYDRUNK") do
192 Citizen.Wait(0)
193 end
194 TaskStartScenarioInPlace(GetPlayerPed(-1), "WORLD_HUMAN_SMOKING_POT", 0, true)
195 Citizen.Wait(10000)
196 DoScreenFadeOut(1000)
197 Citizen.Wait(1000)
198 ClearPedTasksImmediately(GetPlayerPed(-1))
199 SetTimecycleModifier("spectator5")
200 SetPedMotionBlur(GetPlayerPed(-1), true)
201 SetPedMovementClipset(GetPlayerPed(-1), "MOVE_M@DRUNK@SLIGHTLYDRUNK", true)
202 SetPedIsDrunk(GetPlayerPed(-1), true)
203 DoScreenFadeIn(1000)
204 Citizen.Wait(600000)
205 DoScreenFadeOut(1000)
206 Citizen.Wait(1000)
207 DoScreenFadeIn(1000)
208 ClearTimecycleModifier()
209 ResetScenarioTypesEnabled()
210 ResetPedMovementClipset(GetPlayerPed(-1), 0)
211 SetPedIsDrunk(GetPlayerPed(-1), false)
212 SetPedMotionBlur(GetPlayerPed(-1), false)
213end)
214
215-- Opium Effect
216RegisterNetEvent('esx_illegal_drugs:onOpium')
217AddEventHandler('esx_illegal_drugs:onOpium', function()
218 RequestAnimSet("MOVE_M@DRUNK@SLIGHTLYDRUNK")
219 while not HasAnimSetLoaded("MOVE_M@DRUNK@SLIGHTLYDRUNK") do
220 Citizen.Wait(0)
221 end
222 TaskStartScenarioInPlace(GetPlayerPed(-1), "WORLD_HUMAN_SMOKING_POT", 0, true)
223 Citizen.Wait(10000)
224 DoScreenFadeOut(1000)
225 Citizen.Wait(1000)
226 ClearPedTasksImmediately(GetPlayerPed(-1))
227 SetTimecycleModifier("spectator5")
228 SetPedMotionBlur(GetPlayerPed(-1), true)
229 SetPedMovementClipset(GetPlayerPed(-1), "MOVE_M@DRUNK@SLIGHTLYDRUNK", true)
230 SetPedIsDrunk(GetPlayerPed(-1), true)
231 DoScreenFadeIn(1000)
232 Citizen.Wait(600000)
233 DoScreenFadeOut(1000)
234 Citizen.Wait(1000)
235 DoScreenFadeIn(1000)
236 ClearTimecycleModifier()
237 ResetScenarioTypesEnabled()
238 ResetPedMovementClipset(GetPlayerPed(-1), 0)
239 SetPedIsDrunk(GetPlayerPed(-1), false)
240 SetPedMotionBlur(GetPlayerPed(-1), false)
241end)
242
243-- Meth Effect
244RegisterNetEvent('esx_illegal_drugs:onMeth')
245AddEventHandler('esx_illegal_drugs:onMeth', function()
246 RequestAnimSet("MOVE_M@DRUNK@SLIGHTLYDRUNK")
247 while not HasAnimSetLoaded("MOVE_M@DRUNK@SLIGHTLYDRUNK") do
248 Citizen.Wait(0)
249 end
250 TaskStartScenarioInPlace(GetPlayerPed(-1), "mp_player_intdrink", 0, true)
251 Citizen.Wait(10000)
252 DoScreenFadeOut(1000)
253 Citizen.Wait(1000)
254 ClearPedTasksImmediately(GetPlayerPed(-1))
255 SetTimecycleModifier("spectator5")
256 SetPedMotionBlur(GetPlayerPed(-1), true)
257 SetPedMovementClipset(GetPlayerPed(-1), "MOVE_M@DRUNK@SLIGHTLYDRUNK", true)
258 SetPedIsDrunk(GetPlayerPed(-1), true)
259 DoScreenFadeIn(1000)
260 Citizen.Wait(600000)
261 DoScreenFadeOut(1000)
262 Citizen.Wait(1000)
263 DoScreenFadeIn(1000)
264 ClearTimecycleModifier()
265 ResetScenarioTypesEnabled()
266 ResetPedMovementClipset(GetPlayerPed(-1), 0)
267 SetPedIsDrunk(GetPlayerPed(-1), false)
268 SetPedMotionBlur(GetPlayerPed(-1), false)
269end)
270
271-- Coke Effect
272RegisterNetEvent('esx_illegal_drugs:onCoke')
273AddEventHandler('esx_illegal_drugs:onCoke', function()
274 RequestAnimSet("MOVE_M@DRUNK@SLIGHTLYDRUNK")
275 while not HasAnimSetLoaded("MOVE_M@DRUNK@SLIGHTLYDRUNK") do
276 Citizen.Wait(0)
277 end
278 TaskStartScenarioInPlace(GetPlayerPed(-1), "WORLD_HUMAN_SMOKING_POT", 0, true)
279 Citizen.Wait(10000)
280 DoScreenFadeOut(1000)
281 Citizen.Wait(1000)
282 ClearPedTasksImmediately(GetPlayerPed(-1))
283 SetTimecycleModifier("spectator5")
284 SetPedMotionBlur(GetPlayerPed(-1), true)
285 SetPedMovementClipset(GetPlayerPed(-1), "MOVE_M@DRUNK@SLIGHTLYDRUNK", true)
286 SetPedIsDrunk(GetPlayerPed(-1), true)
287 DoScreenFadeIn(1000)
288 Citizen.Wait(600000)
289 DoScreenFadeOut(1000)
290 Citizen.Wait(1000)
291 DoScreenFadeIn(1000)
292 ClearTimecycleModifier()
293 ResetScenarioTypesEnabled()
294 ResetPedMovementClipset(GetPlayerPed(-1), 0)
295 SetPedIsDrunk(GetPlayerPed(-1), false)
296 SetPedMotionBlur(GetPlayerPed(-1), false)
297end)
298
299-- Render markers
300Citizen.CreateThread(function()
301 while true do
302
303 Wait(0)
304
305 local coords = GetEntityCoords(GetPlayerPed(-1))
306
307 for k,v in pairs(Config.Zones) do
308 if(GetDistanceBetweenCoords(coords, v.x, v.y, v.z, true) < Config.DrawDistance) then
309 DrawMarker(Config.MarkerType, v.x, v.y, v.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.ZoneSize.x, Config.ZoneSize.y, Config.ZoneSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false)
310 end
311 end
312
313 end
314end)
315
316-- Create Blips
317Citizen.CreateThread(function()
318 if Config.DisableBlip == false then
319 for i=1, #Config.Map, 1 do
320
321 local blip = AddBlipForCoord(Config.Map[i].x, Config.Map[i].y, Config.Map[i].z)
322 SetBlipSprite (blip, Config.Map[i].id)
323 SetBlipDisplay(blip, 4)
324 SetBlipColour (blip, Config.Map[i].color)
325 SetBlipScale (blip, Config.Map[i].scale)
326 SetBlipAsShortRange(blip, true)
327
328 BeginTextCommandSetBlipName("STRING")
329 AddTextComponentString(Config.Map[i].name)
330 EndTextCommandSetBlipName(blip)
331 end
332 end
333end)
334
335-- RETURN NUMBER OF ITEMS FROM SERVER
336RegisterNetEvent('esx_illegal_drugs:ReturnInventory')
337AddEventHandler('esx_illegal_drugs:ReturnInventory', function(cokeNbr, cokepNbr, methNbr, methpNbr, weedNbr, weedpNbr, opiumNbr, opiumpNbr, jobName, currentZone)
338 cokeQTE = cokeNbr
339 coke_poochQTE = cokepNbr
340 methQTE = methNbr
341 meth_poochQTE = methpNbr
342 weedQTE = weedNbr
343 weed_poochQTE = weedpNbr
344 opiumQTE = opiumNbr
345 opium_poochQTE = opiumpNbr
346 myJob = jobName
347 TriggerEvent('esx_illegal_drugs:hasEnteredMarker', currentZone)
348end)
349
350-- Activate menu when player is inside marker
351Citizen.CreateThread(function()
352 while true do
353
354 Citizen.Wait(0)
355
356 local coords = GetEntityCoords(GetPlayerPed(-1))
357 local isInMarker = false
358 local currentZone = nil
359
360 for k,v in pairs(Config.Zones) do
361 if(GetDistanceBetweenCoords(coords, v.x, v.y, v.z, true) < Config.ZoneSize.x / 2) then
362 isInMarker = true
363 currentZone = k
364 end
365 end
366
367 if isInMarker and not hasAlreadyEnteredMarker then
368 hasAlreadyEnteredMarker = true
369 lastZone = currentZone
370 TriggerServerEvent('esx_illegal_drugs:GetUserInventory', currentZone)
371 end
372
373 if not isInMarker and hasAlreadyEnteredMarker then
374 hasAlreadyEnteredMarker = false
375 TriggerEvent('esx_illegal_drugs:hasExitedMarker', lastZone)
376 end
377
378 if isInMarker and isInZone then
379 TriggerEvent('esx_illegal_drugs:hasEnteredMarker', 'exitMarker')
380 end
381 end
382end)
383
384-- Key Controls
385Citizen.CreateThread(function()
386 while true do
387 Citizen.Wait(10)
388 if CurrentAction ~= nil then
389 SetTextComponentFormat('STRING')
390 AddTextComponentString(CurrentActionMsg)
391 DisplayHelpTextFromStringLabel(0, 0, 1, -1)
392 if IsControlJustReleased(0, 26) then
393 if CurrentAction == 'exitMarker' then
394 TriggerEvent('esx_illegal_drugs:hasExitedMarker', lastZone)
395 Citizen.Wait(1000)
396 elseif CurrentAction == 'CokeField' then
397 TriggerServerEvent('esx_illegal_drugs:startHarvestCoke')
398 elseif CurrentAction == 'CokeProcessing' then
399 TriggerServerEvent('esx_illegal_drugs:startTransformCoke')
400 elseif CurrentAction == 'CokeDealer' then
401 TriggerServerEvent('esx_illegal_drugs:startSellCoke')
402 elseif CurrentAction == 'MethField' then
403 TriggerServerEvent('esx_illegal_drugs:startHarvestMeth')
404 elseif CurrentAction == 'MethProcessing' then
405 TriggerServerEvent('esx_illegal_drugs:startTransformMeth')
406 elseif CurrentAction == 'MethDealer' then
407 TriggerServerEvent('esx_illegal_drugs:startSellMeth')
408 elseif CurrentAction == 'WeedField' then
409 TriggerServerEvent('esx_illegal_drugs:startHarvestWeed')
410 TriggerEvent('esx_illegal_drugs:HarvestWeedAnimation')
411 elseif CurrentAction == 'WeedProcessing' then
412 TriggerServerEvent('esx_illegal_drugs:startTransformWeed')
413 TriggerEvent('esx_illegal_drugs:TransformWeedAnimation')
414 elseif CurrentAction == 'WeedDealer' then
415 TriggerServerEvent('esx_illegal_drugs:startSellWeed')
416 TriggerEvent('esx_illegal_drugs:SellWeedAnimation')
417 elseif CurrentAction == 'OpiumField' then
418 TriggerServerEvent('esx_illegal_drugs:startHarvestOpium')
419 elseif CurrentAction == 'OpiumProcessing' then
420 TriggerServerEvent('esx_illegal_drugs:startTransformOpium')
421 elseif CurrentAction == 'OpiumDealer' then
422 TriggerServerEvent('esx_illegal_drugs:startSellOpium')
423 else
424 isInZone = false -- not a esx_illegal_drugs zone
425 end
426 CurrentAction = nil
427 end
428 end
429 end
430end)
431
432
433
434----------------------------------------------------------
435--------------------STOP HARVEST/TRANSFORM/SELL-----------
436----------------------------------------------------------
437Citizen.CreateThread(function()
438 while true do
439 Citizen.Wait(0)
440 local ped = GetPlayerPed( -1 )
441 if IsControlJustPressed(0, 32) or IsControlJustPressed(0, 33) then
442 TriggerServerEvent('esx_illegal_drugs:stopHarvestWeed')
443 TriggerServerEvent('esx_illegal_drugs:stopTransformWeed')
444 TriggerServerEvent('esx_illegal_drugs:stopSellWeed')
445 TriggerServerEvent('esx_illegal_drugs:stopHarvestCoke')
446 TriggerServerEvent('esx_illegal_drugs:stopTransformCoke')
447 TriggerServerEvent('esx_illegal_drugs:stopSellCoke')
448 TriggerServerEvent('esx_illegal_drugs:stopHarvestMeth')
449 TriggerServerEvent('esx_illegal_drugs:stopTransformMeth')
450 TriggerServerEvent('esx_illegal_drugs:stopSellMeth')
451 TriggerServerEvent('esx_illegal_drugs:stopHarvestOpium')
452 TriggerServerEvent('esx_illegal_drugs:stopTransformOpium')
453 TriggerServerEvent('esx_illegal_drugs:stopSellOpium')
454 end
455 end
456end)
457----------------------------------------------------------
458--------------------STOP HARVEST/TRANSFORM/SELL-----------
459----------------------------------------------------------
460
461----------------------------------------------------------
462--------------------HARVEST WEED ANIMATION----------------
463----------------------------------------------------------
464RegisterNetEvent('esx_illegal_drugs:HarvestWeedAnimation')
465AddEventHandler('esx_illegal_drugs:HarvestWeedAnimation', function()
466 local ped = GetPlayerPed(-1)
467 local x,y,z = table.unpack(GetEntityCoords(playerPed, true))
468 if not IsEntityPlayingAnim(ped, "anim@amb@business@weed@weed_inspecting_lo_med_hi@", "weed_stand_checkingleaves_kneeling_01_inspector", 3) then
469 RequestAnimDict("anim@amb@business@weed@weed_inspecting_lo_med_hi@")
470 while not HasAnimDictLoaded("anim@amb@business@weed@weed_inspecting_lo_med_hi@") do
471 Citizen.Wait(100)
472 end
473 SetEntityCoords(PlayerPedId(), 1057.54, -3197.39, -40.14)
474 SetEntityHeading(PlayerPedId(), 171.5)
475 Wait(100)
476 TaskPlayAnim(ped, "anim@amb@business@weed@weed_inspecting_lo_med_hi@", "weed_stand_checkingleaves_kneeling_01_inspector", 8.0, -8, -1, 49, 0, 0, 0, 0)
477 Wait(2000)
478 while IsEntityPlayingAnim(ped, "anim@amb@business@weed@weed_inspecting_lo_med_hi@", "weed_stand_checkingleaves_kneeling_01_inspector", 3) do
479 Wait(1)
480 if (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
481 ClearPedTasksImmediately(ped)
482 break
483 end
484 end
485 end
486end)
487----------------------------------------------------------
488--------------------HARVEST WEED ANIMATION----------------
489----------------------------------------------------------
490
491
492----------------------------------------------------------
493--------------------TRANSFORM WEED ANIMATION--------------
494----------------------------------------------------------
495RegisterNetEvent('esx_illegal_drugs:TransformWeedAnimation')
496AddEventHandler('esx_illegal_drugs:TransformWeedAnimation', function()
497 local ped = GetPlayerPed(-1)
498 local x,y,z = table.unpack(GetEntityCoords(playerPed, true))
499 if not IsEntityPlayingAnim(ped, "anim@amb@business@weed@weed_sorting_seated@", "sorter_right_sort_v3_sorter02", 3) then
500 RequestAnimDict("anim@amb@business@weed@weed_sorting_seated@")
501 while not HasAnimDictLoaded("anim@amb@business@weed@weed_sorting_seated@") do
502 Citizen.Wait(100)
503 end
504 SetEntityCoords(PlayerPedId(), 1037.53, -3205.37, -39.18)
505 SetEntityHeading(PlayerPedId(), 269.5)
506 Wait(100)
507 ----TaskStartScenarioInPlace(playerPed, "PROP_HUMAN_SEAT_CHAIR", 0, false) ---Does not work
508 TaskPlayAnim(ped, "anim@amb@business@weed@weed_sorting_seated@", "sorter_right_sort_v3_sorter02", 8.0, -8, -1, 49, 0, 0, 0, 0)
509 Wait(2000)
510 while IsEntityPlayingAnim(ped, "anim@amb@business@weed@weed_sorting_seated@", "sorter_right_sort_v3_sorter02", 3) do
511 Wait(1)
512 if (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
513 ClearPedTasksImmediately(ped)
514 break
515 end
516 end
517 end
518end)
519----------------------------------------------------------
520--------------------TRANSFORM WEED ANIMATION--------------
521----------------------------------------------------------
522
523
524
525----------------------------------------------------------
526--------------------SELL WEED ANIMATION-------------------
527----------------------------------------------------------
528--[[RegisterNetEvent('esx_illegal_drugs:SellWeedAnimation')
529AddEventHandler('esx_illegal_drugs:SellWeedAnimation', function()
530 local ped = GetPlayerPed(-1)
531 local x,y,z = table.unpack(GetEntityCoords(playerPed, true))
532 if not IsEntityPlayingAnim(ped, "anim@heists@biolab@ig_1_karen_codes", "handover_cam", 3) then
533 RequestAnimDict("anim@heists@money_grab@briefcase")
534 while not HasAnimDictLoaded("anim@heists@money_grab@briefcase") do
535 Citizen.Wait(100)
536 end
537 --SetEntityCoords(PlayerPedId(), 1037.53, -3205.37, -39.18)
538 --SetEntityHeading(PlayerPedId(), 269.5)
539 --Wait(100)
540 ----TaskStartScenarioInPlace(playerPed, "PROP_HUMAN_SEAT_CHAIR", 0, false) ---Does not work
541 TaskPlayAnim(ped, "anim@heists@money_grab@briefcase", "handover_cam", 8.0, -8, -1, 49, 0, 0, 0, 0)
542 Wait(2000)
543 while IsEntityPlayingAnim(ped, "anim@heists@money_grab@briefcase", "handover_cam", 3) do
544 Wait(1)
545 if (IsControlPressed(0, 32) or IsControlPressed(0, 33) or IsControlPressed(0, 34) or IsControlPressed(0, 35)) then
546 ClearPedTasksImmediately(ped)
547 break
548 end
549 end
550 end
551end)]]--
552----------------------------------------------------------
553--------------------SELL WEED ANIMATION-------------------
554----------------------------------------------------------
555
556
557-- Disable Controls
558Citizen.CreateThread(function()
559 while true do
560 Citizen.Wait(1)
561 local playerPed = PlayerPedId(-1)
562
563 if HasAlreadyEnteredMarker then
564 DisableControlAction(0, 24, true) -- Attack
565 DisableControlAction(0, 257, true) -- Attack 2
566 DisableControlAction(0, 25, true) -- Aim
567 DisableControlAction(0, 263, true) -- Melee Attack 1
568 DisableControlAction(0, 47, true) -- Disable weapon
569 DisableControlAction(0, 264, true) -- Disable melee
570 DisableControlAction(0, 257, true) -- Disable melee
571 DisableControlAction(0, 140, true) -- Disable melee
572 DisableControlAction(0, 141, true) -- Disable melee
573 DisableControlAction(0, 142, true) -- Disable melee
574 DisableControlAction(0, 143, true) -- Disable melee
575 else
576 Citizen.Wait(500)
577 end
578 end
579end)
580© 2020 GitHub, Inc.
581Terms
582Privacy
583Security
584Status
585Help
586Contact GitHub
587Pricing
588API
589Training
590Blog
591About