Jump to content

Dead body


Recommended Posts

Posted

Hello guys, today I was thinking about if is this possible if someone dies the dead body stays at the position where he died and the player is respawns. Hope you understand me. If is this possible what events and functions should I use to make this?

  • Moderators
Posted

Serverside:

Events:

"onPlayerWasted" 

Functions:

getElementPosition 
getElementRotation 
createPed 
killPed 

and maybe for removing the peds after a while:

  
setTimer 
getTickCount() 
destroyElement 
  

Posted

I have another question. Is this possible to stop the flying camera when a player gets wasted? Because I want to make a timer for respawn, and I want the camera to stay at the player. How is this even possible? I've already seen it in a video.

  • Moderators
Posted (edited)

By using setCameraMatrix

You can try this:

  
local x, y, z, lx, ly, lz = 0,0,0,0,0,0 
local antiCameraBugHandler = false 
local stopCameraBugFunction  
stopCameraBugFunction = function() 
    if getElementHealth(localPlayer) > 0 then 
        removeEventHandler("onClientRender",stopCameraBugFunction) 
        antiCameraBugHandler = false 
        setCameraTarget (localPlayer) 
    else 
        setCameraMatrix (x, y, z, lx, ly, lz) 
    end 
end 
  
addEventHandler("onClientPlayerWasted",localPlayer, 
function() 
    if not antiCameraBugHandler then 
        x, y, z, lx, ly, lz = getCameraMatrix () 
        antiCameraBugHandler = true 
        addEventHandler("onClientRender",stopCameraBugFunction) 
    end 
end) 
  
  

Edited by Guest
Posted
By using setCameraMatrix

You can try this:

  
local antiCameraBugHandler = false 
local stopCameraBugFunction  
stopCameraBugFunction = function() 
    if getElementHealth(localPlayer) > 0 then 
        removeEventHandler("onClientRender",stopCameraBugFunction) 
        antiCameraBugHandler = false 
        setCameraTarget (localPlayer) 
    else 
        local x, y, z, lx, ly, lz = getCameraMatrix () 
        setCameraMatrix (x, y, z, lx, ly, lz) 
    end 
end 
  
addEventHandler("onClientPlayerWasted",localPlayer, 
function() 
    if not antiCameraBugHandler then 
        antiCameraBugHandler = true 
        addEventHandler("onClientRender",stopCameraBugFunction) 
    end 
end) 
  
  

It seems like it's not working. :( No changes when I die, it's like before. Do you have any other ideas?

  • Moderators
Posted

It seems like it's not working. :( No changes when I die, it's like before. Do you have any other ideas?

Edited(see last post)

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...