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?

Your signature image is too large.

Removed

  • Moderators
Posted

Serverside:

Events:

"onPlayerWasted" 

Functions:

getElementPosition 
getElementRotation 
createPed 
killPed 

and maybe for removing the peds after a while:

  
setTimer 
getTickCount() 
destroyElement 
  

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

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.

Your signature image is too large.

Removed

  • 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

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

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?

Your signature image is too large.

Removed

Posted

Creating a ped client-side and seting a target to it until you revive.

My ingame nick is ~HyPeX~

BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager

gKhdyRJ.png

  • 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)

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

  • 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...