Advertisement
Guest User

hmmm

a guest
Apr 12th, 2018
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. RegisterNetEvent('bodybagen')
  2. AddEventHandler('bodybagen', function()
  3. local distanceToCheck = 5.0
  4. local ped = GetPlayerPed( -1 )
  5.  
  6. if ( DoesEntityExist(ped) and IsPedDead(ped) ) then
  7. local pos = GetEntityCoords(ped)
  8.  
  9. if ( DoesEntityExist(peds) ) then
  10. ShowNotification( "~r~Unable to use bodybag, try again." )
  11. else
  12. ShowNotification( "local has been bodybaged." )
  13. end
  14. end
  15. else
  16. local playerPos = GetEntityCoords( ped, 1 )
  17. local inFrontOfPlayer = GetOffsetFromEntityInWorldCoords( ped, 0.0, distanceToCheck, 0.0 )
  18. local peds = ( playerPos, inFrontOfPlayer )
  19.  
  20. if ( DoesEntityExist(peds) ) then
  21. SetEntityAsMissionEntity(peds, true, true)
  22. deletePed(peds)
  23.  
  24. function DeletePed(entity)
  25. Citizen.InvokeNative( 0x9614299DCB53E54B, Citizen.PointerValueIntInitialized( entity ) )
  26. end
  27.  
  28. function GetEntityCoords(coordFrom, coordTo)
  29. local rayHandle (coordFrom.x, coordFrom.y, coordFrom.z, coordTo.x, coordTo.y, coordTo.z, 10, GetPlayerPed( -1 ), 0 )
  30. local peds = GetEntityCoords(rayHandle)
  31. return peds
  32. end
  33.  
  34. function ShowNotification( text )
  35. SetNotificationTextEntry( "STRING" )
  36. AddTextComponentString( text )
  37. DrawNotification( false, false )
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement