Manic69 Posted July 26, 2017 Share Posted July 26, 2017 I have this duty : function giveblood (thePlayer) local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then outputChatBox ("#FC7D01[Owner] #FFFFFF"..getPlayerName(thePlayer).."#00FF00 Is now onduty NO DM !",root,255,255,255,true) setElementData(thePlayer, "blood", 9999999999999999999) end end addCommandHandler("duty", giveblood) function bloodback(thePlayer) local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then outputChatBox ("#FC7D01[Owner] #FFFFFF"..getPlayerName(thePlayer).."#FF0000 Is now offduty",root,255,255,255,true) setElementData(thePlayer, "blood", 12000) end end addCommandHandler("offduty", bloodback) My problem is If I fall down or Something explosing i die. Link to comment
itHyperoX Posted July 26, 2017 Share Posted July 26, 2017 (edited) function giveblood (thePlayer) local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then outputChatBox ("#FC7D01[Owner] #FFFFFF"..getPlayerName(thePlayer).."#00FF00 Is now onduty NO DM !",root,255,255,255,true) setElementData(thePlayer,"dutyON",1) end end addCommandHandler("duty", giveblood) function bloodback(thePlayer) local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then outputChatBox ("#FC7D01[Owner] #FFFFFF"..getPlayerName(thePlayer).."#FF0000 Is now offduty",root,255,255,255,true) setElementData(thePlayer,"dutyON",0) end end addCommandHandler("offduty", bloodback) -- Client side! addEventHandler("onClientPlayerDamage", getRootElement(), function() if getElementData(localPlayer, "dutyON") == 1 then cancelEvent() end end ) Edited July 26, 2017 by TheMOG Link to comment
Manic69 Posted July 26, 2017 Author Share Posted July 26, 2017 (edited) explosing good but fall down not Edited July 26, 2017 by Manic69 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