Advertisement
Guest User

Untitled

a guest
Jul 21st, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.25 KB | None | 0 0
  1. local pressed = false
  2. local ped = GetPlayerPed(-1)
  3.  
  4. Citizen.CreateThread(function()
  5.     while true do
  6.         Citizen.Wait(1)
  7.         ped = GetPlayerPed(-1)
  8.         if (GetSelectedPedWeapon(ped) == GetHashKey("WEAPON_FIREEXTINGUISHER") and IsPedShooting(ped)) then
  9.             --local boneIndex = GetPedBoneIndex(PlayerPedId(), 0x49d9)
  10.             --local dankBoneCoords = GetPedBoneCoords(PlayerPedId(), boneIndex, rot.x, rot.y, rot.z)
  11.             Citizen.Trace("While Loop Spam")
  12.             RequestNamedPtfxAsset("core")
  13.            
  14.             while (not HasNamedPtfxAssetLoaded("core")) do
  15.                 Citizen.Wait(1)
  16.             end
  17.             SetPtfxAssetNextCall("core")
  18.             local particleEffect = StartParticleFxLoopedOnEntity("water_cannon_jet", ped, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 1.0, false, false, false)
  19.             pressed = true
  20.             while (GetSelectedPedWeapon(ped) == GetHashKey("WEAPON_FIREEXTINGUISHER") and IsPedShooting(ped)) do
  21.                 SetParticleFxLoopedOffsets(particleEffect, 0.0, 0.0, 0.0, GetGameplayCamRelativePitch(), 0.0, 0.0)
  22.                 Citizen.Wait(1)
  23.             end
  24.             StopParticleFxLooped(particleEffect, 0)
  25.             pressed = false
  26.            
  27.             Citizen.Trace("Shooting WEAPON_FIREEXTINGUISHER")
  28.         end
  29.     end
  30.     Citizen.Wait(1)
  31. end)
  32.  
  33.  
  34. function PlayEffect(pdict, pname, posx, posy, posz)
  35.     Citizen.CreateThread(function()
  36.         SetPtfxAssetNextCall(pdict)
  37.         local pfx = StartParticleFxLoopedAtCoord(pname, posx, posy, posz, 0.0, 0.0, GetEntityHeading(ped), 1.0, false, false, false, false)
  38.         Citizen.Wait(100)
  39.         StopParticleFxLooped(pfx, 0)
  40.     end)
  41. end
  42.  
  43. Citizen.CreateThread(function()
  44.     while true do
  45.         if pressed then
  46.             Citizen.Wait(100)
  47.             SetParticleFxShootoutBoat(true)
  48.             local off = GetOffsetFromEntityInWorldCoords(ped, 0.0, 12.0 + GetGameplayCamRelativePitch()* 0.4, 0.0)
  49.             local x = off.x
  50.             local y = off.y
  51.            
  52.  
  53.             --DrawLine(x, y, 0.0, x, y, 800.0, 255, 0, 0, 255)
  54.             local _,z = GetGroundZFor_3dCoord(x, y, off.z)
  55.             --DrawLine(x, y, z - 0.2, x, y, z + 0.2, 255, 0, 0, 255)
  56.             Citizen.Wait(GetGameplayCamRelativePitch())
  57.             PlayEffect("core", "water_cannon_spray", x, y, z)
  58.         else
  59.             Citizen.Wait(1)
  60.         end
  61.     end
  62. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement