shoBy Posted September 5, 2014 Share Posted September 5, 2014 Hey guys..You know dayz version from mta. I found a godmode system but I can die...You know...on this mod is with blood...Can you help me to set blood 99999999 when I have godmode? If you can, i want on the global chat to write infront the name [ON-DUTY]playername when the godmode is on. Server.lua function toggleGodMode(thePlayer) local account = getPlayerAccount(thePlayer) if (not account or isGuestAccount(account)) then return end local accountName = getAccountName(account) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then if getElementData(thePlayer,"invincible") then setElementData(thePlayer,"invincible",false) outputChatBox("God Mode is now Disabled.",thePlayer,0,255,0) else setElementData(thePlayer,"invincible",true) outputChatBox("God Mode is now Enabled.",thePlayer,0,255,0) end end end addCommandHandler("godmode",toggleGodMode) Client.lua addEventHandler ( "onClientPlayerDamage",root, function () if getElementData(source,"invincible") then cancelEvent() end end) addEventHandler("onClientPlayerStealthKill",localPlayer, function (targetPlayer) if getElementData(targetPlayer,"invincible") then cancelEvent() end end) Link to comment
Mr.Aleks Posted September 5, 2014 Share Posted September 5, 2014 I think in dayZ, the player's blood can be controlled using elementData. Link to comment
shoBy Posted September 5, 2014 Author Share Posted September 5, 2014 Can you help me ? Link to comment
Mr.Aleks Posted September 5, 2014 Share Posted September 5, 2014 You have to search which is the data of the blood, then add it using for example setElementData(player, "blood", 9999999) Link to comment
shoBy Posted September 5, 2014 Author Share Posted September 5, 2014 I want to see, how it looks on script Link to comment
Mr.Aleks Posted September 5, 2014 Share Posted September 5, 2014 To change the player's blood you have to use: setElementData(thePlayer, "blood" 9999999)--here you set to 'thePlayer' value '9999999' of blood. Link to comment
shoBy Posted September 5, 2014 Author Share Posted September 5, 2014 Please, change it on the script. Link to comment
Mr.Aleks Posted September 5, 2014 Share Posted September 5, 2014 function toggleGodMode(thePlayer) local account = getPlayerAccount(thePlayer) if (not account or isGuestAccount(account)) then return end local accountName = getAccountName(account) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then if getElementData(thePlayer,"invincible") == true then setElementData(thePlayer,"invincible",false) outputChatBox("God Mode is now Disabled.",thePlayer,0,255,0) else setElementData(thePlayer,"invincible",true) setElementData(thePlayer, "blood", 999999) outputChatBox("God Mode is now Enabled.",thePlayer,0,255,0) end end end addCommandHandler("godmode",toggleGodMode) Link to comment
shoBy Posted September 5, 2014 Author Share Posted September 5, 2014 It works. Thanks. 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