Tokio Posted September 2, 2017 Share Posted September 2, 2017 client: if getElementData(player, "showImage") then dxDrawImage (sx-34, sy-95, 55, 55, 'logo.png' ) else dxDrawImage (sx-34, sy-95, 55, 55, 'air.png' ) end server: function setDataOnLogin(player) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("FoAdmin")) then setElementData(source, "showImage", true) end end addEventHandler("onPlayerLogin", root, setDataOnLogin) function setDataOnResourceStart(player) for i, v in ipairs(getElementsByType("player")) do if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("FoAdmin")) then setElementData(v, "showImage", true) end end end addEventHandler("onResourceStart", resourceRoot, setDataOnResourceStart) function removeDataOnLogout() setElementData(source, "showImage", false) end addEventHandler("onPlayerLogout", root, removeDataOnLogout) i have a error: server.lua:31: attempt to concatenate a boolean value.. how to fix? Link to comment
WorthlessCynomys Posted September 2, 2017 Share Posted September 2, 2017 Which line is line 31? Link to comment
Tokio Posted September 2, 2017 Author Share Posted September 2, 2017 2 minutes ago, StormFighter said: Which line is line 31? if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("FoAdmin")) then Link to comment
ViRuZGamiing Posted September 2, 2017 Share Posted September 2, 2017 Your player parameter is undefined, get the player from the value when looping function setDataOnResourceStart() for i, v in ipairs(getElementsByType("player")) do if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(v)),aclGetGroup("FoAdmin")) then setElementData(v, "showImage", true) end end end addEventHandler("onResourceStart", resourceRoot, setDataOnResourceStart) 1 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