Blueman Posted February 17, 2012 Share 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 Link to comment
Blueman Posted February 17, 2012 Author Share 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 Link to comment
drk Posted February 17, 2012 Share 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. Link to comment
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