Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RegisterNetEvent('bodybagen')
- AddEventHandler('bodybagen', function()
- local distanceToCheck = 5.0
- local ped = GetPlayerPed( -1 )
- if ( DoesEntityExist(ped) and IsPedDead(ped) ) then
- local pos = GetEntityCoords(ped)
- if ( DoesEntityExist(peds) ) then
- ShowNotification( "~r~Unable to use bodybag, try again." )
- else
- ShowNotification( "local has been bodybaged." )
- end
- end
- else
- local playerPos = GetEntityCoords( ped, 1 )
- local inFrontOfPlayer = GetOffsetFromEntityInWorldCoords( ped, 0.0, distanceToCheck, 0.0 )
- local peds = ( playerPos, inFrontOfPlayer )
- if ( DoesEntityExist(peds) ) then
- SetEntityAsMissionEntity(peds, true, true)
- deletePed(peds)
- function DeletePed(entity)
- Citizen.InvokeNative( 0x9614299DCB53E54B, Citizen.PointerValueIntInitialized( entity ) )
- end
- function GetEntityCoords(coordFrom, coordTo)
- local rayHandle (coordFrom.x, coordFrom.y, coordFrom.z, coordTo.x, coordTo.y, coordTo.z, 10, GetPlayerPed( -1 ), 0 )
- local peds = GetEntityCoords(rayHandle)
- return peds
- end
- function ShowNotification( text )
- SetNotificationTextEntry( "STRING" )
- AddTextComponentString( text )
- DrawNotification( false, false )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement