Advertisement
Guest User

Untitled

a guest
Mar 16th, 2017
1,217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.06 KB | None | 0 0
  1. --Client Script--
  2. -- Scripted by X. Cross && Jon P. --
  3. RegisterNetEvent("Handsup")
  4. AddEventHandler("Handsup", function()
  5.     local lPed = GetPlayerPed(-1)
  6.     if DoesEntityExist(lPed) then
  7.         Citizen.CreateThread(function()
  8.             RequestAnimDict("random@mugging3")
  9.             while not HasAnimDictLoaded("random@mugging3") do
  10.                 Citizen.Wait(100)
  11.             end
  12.            
  13.             if IsEntityPlayingAnim(lPed, "random@mugging3", "handsup_standing_base", 3) then
  14.                 ClearPedSecondaryTask(lPed)
  15.                 SetEnableHandcuffs(lPed, false)
  16.                 TriggerEvent("chatMessage", "", {255, 0, 0}, "Your have put your hands down.")
  17.             else
  18.                 TaskPlayAnim(lPed, "random@mugging3", "handsup_standing_base", 8.0, -8, -1, 49, 0, 0, 0, 0)
  19.                 SetEnableHandcuffs(lPed, true)
  20.                 TriggerEvent("chatMessage", "", {255, 0, 0}, "Your hands are up.")
  21.             end    
  22.         end)
  23.     end
  24. end)
  25.  
  26. --Server Script--
  27. -- Scripted by X. Cross && Jon P.--
  28. RegisterServerEvent("chatMessage")
  29. AddEventHandler("chatMessage", function(source, n, message)
  30.     if message == "/hu" then
  31.         CancelEvent()
  32.         TriggerClientEvent("Handsup", source)
  33.     end
  34. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement