Blueman Posted February 17, 2012 Posted February 17, 2012 (edited) 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 February 17, 2012 by Guest It's amazing what people will sell nowadays $500 for an animated gif
drk Posted February 17, 2012 Posted February 17, 2012 'user' is nil. EPT Team Server Development: 0% Learning C++ | C++ is amazing
Blueman Posted February 17, 2012 Author Posted February 17, 2012 I know that I am still working on it that isn't my problem I get the error end expected near else It's amazing what people will sell nowadays $500 for an animated gif
drk Posted February 17, 2012 Posted February 17, 2012 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. EPT Team Server Development: 0% Learning C++ | C++ is amazing
Blueman Posted February 17, 2012 Author Posted February 17, 2012 Thanks. It's amazing what people will sell nowadays $500 for an animated gif
drk Posted February 17, 2012 Posted February 17, 2012 You're welcome EPT Team Server Development: 0% Learning C++ | C++ is amazing
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now