Advertisement
Guest User

bodybag

a guest
Apr 11th, 2018
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. Client
  2. RegisterCommand('nl:bodybag')
  3. AddEventHandler('nl:bodybag', function()
  4. local entity = SetClosestEntity()
  5. end
  6.  
  7. if (distance ~= -1 and distance < 5) then
  8. TriggerServerEvent("nl:bodybag")
  9. else
  10. ShowNotification("No ped nearby, try again.")
  11. else
  12. ShowNotification("Bodybag Success.")
  13. end
  14. end
  15. end
  16.  
  17. function deleteped(entity)
  18. Citizen.InvokeNative( 0x9614299DCB53E54B, Citizen.PointerValueIntInitialized(entity) )
  19. end
  20. function SetClosestEntity()
  21. local handle, ped = FindFirstPed()
  22. local finished = false
  23.  
  24.  
  25. function ShowNotification( text )
  26. SetNotificationTextEntry( "STRING" )
  27. AddTextComponentString(text)
  28. DrawNotification(false, false)
  29. end
  30.  
  31.  
  32. Server
  33. AddEventHandler( 'chatMessage', function( source, n, msg )
  34. msg = string.lower( msg )
  35. if (msg == "/bodybag") then
  36. TriggerClientEvent( 'nl:bodybag', source )
  37. end
  38. end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement