Jump to content

How to block DM in interiors?


Recommended Posts

Posted

Welcome.

How I could block fire and aiming keys in interiors? I'm just getting invisible bug, when a player dies in interior and a player needs to /reconnect to fix that. Or... Maybe somebody knows, how to fix this bug?

Thanks for every answer. :)

Posted

That's strange, because spawnPlayer sets interior to 0 by default, i don't think that the script would spawn it wrong.

Try this:

addEventHandler("onPlayerSpawn", root, 
function () 
setElementInterior(source, 0) 
end) 

To make sure that it's 0.

Posted

If you want to disable damage in interiors you can just use these:

  
"onClientPlayerDamage" -- Triggers when a player is damaged 
getElementInterior() -- Check if the player is in an interior or outside(interior 0) 
cancelEvent() -- If yes, cancel the damage 
  

Make sure this script is clientside.

Posted
function fncClientPlayerDamage() 
    if not (getElementInterior(source) == 0) then 
        cancelEvent() 
    end 
end 
addEventHandler("onClientPlayerDamage",getRootElement(),fncClientPlayerDamage() 

Add this to your client script. This will cancel out every damage done to a player inside an interior.

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