Jump to content

Help


Blueman

Recommended Posts

The goal of this script is to make the player invincible but the server sided command doesn't work for some reason.

server:

  
function setInince(user, commandname) 
if (hasObjectPermissionTo(user, "function.banPlayer")) then 
   if (getElementData(user, "INV") == "true") then 
      setElementData("INV", "false") 
      outputChatBox("You are no longer Invincible", user) 
   else 
     setElementData("INV", "true") 
    outputChatBox("You are now Invincible", user) 
else  
    outputChatBOX("You do not have permission for this", user) 
   end 
 end 
end 
addCommandHandler("INCI", setInince) 
  

Client:

  
function noadmdamage() 
if (getElementData(source, "INV") == "true") then 
    cancelEvent() 
else 
 end 
end 
addEventHandler("onClientPlayerDamage", getRootElement(), noadmdamage) 
  

Edited by Guest
Link to comment
function setInince(thePlayer) 
    if (hasObjectPermissionTo(thePlayer, "function.banPlayer")) then 
        if (getElementData(thePlayer, "INV") == "true") then 
            setElementData(thePlayer,"INV", "false") 
            outputChatBox("You are no longer Invincible", thePlayer) 
        else 
            setElementData(thePlayer,"INV", "true") 
            outputChatBox("You are now Invincible", thePlayer) 
        end 
    else 
        outputChatBox("You do not have permission for this", thePlayer) 
    end 
end 
addCommandHandler("INCI", setInince) 
  

Tested.

Link to comment

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