Meh, tried to fix your code a bit using local defined variables:
-- server
local plrGodadmin = false
function SetGodAdmin(P)
if isGuestAccount(getPlayerAccount(P)) then
outputChatBox("Only Admins can use this", P, 255, 0, 0)
return
end -- guest
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(P)),aclGetGroup( "Admin" )) then -- is admin?
if (plrGodadmin == true) then -- if data is true
plrGodadmin = false -- lets remove
outputChatBox("God mod off",P)
elseif (plrGodadmin == false) then -- else lets activate
plrGodadmin = true
outputChatBox("God mod on",P)
else
return
end
end
end
addCommandHandler("god", SetGodAdmin)
-- client
addEventHandler("onClientPlayerDamage", getLocalPlayer(),
function()
if (plrGodadmin == true) then
cancelEvent()
end
end
)
I can also use element data, buh, try it this way. (Untested)