PanBob Posted March 19, 2017 Share Posted March 19, 2017 I'm looking for a script that will display before nick player if he has the status of Admin before nickname will be (Admin) nick. Sorry for my english. Link to comment
NeXuS™ Posted March 19, 2017 Share Posted March 19, 2017 addEventHandler("onPlayerChat", getRootElement(), function(msg) if (isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then cancelEvent() outputChatBox("[Admin] " .. getPlayerName(source) .. ": " .. msg, getRootElement(), 255, 255, 255, true) end end) Should work, not tested tho. Link to comment
PanBob Posted March 25, 2017 Author Share Posted March 25, 2017 On 19.03.2017 at 22:13, NeXuS™ said: addEventHandler("onPlayerChat", getRootElement(), function(msg) if (isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then cancelEvent() outputChatBox("[Admin] " .. getPlayerName(source) .. ": " .. msg, getRootElement(), 255, 255, 255, true) end end) Should work, not tested tho. It does not work. .lua: addEventHandler("onPlayerChat", getRootElement(), function(msg) if (isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then cancelEvent() outputChatBox("[Admin] " .. getPlayerName(source) .. ": " .. msg, getRootElement(), 255, 255, 255, true) end end meta.xml: <meta> <info author="PanBob" type="script" /> <script src="tag.lua" type="server" /> </meta> what is wrong? Link to comment
NeXuS™ Posted March 25, 2017 Share Posted March 25, 2017 Are ya in the Admin ACL group? *EDIT* Just found out that a bracket was missing. addEventHandler("onPlayerChat", getRootElement(), function(msg) if (isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin"))) then cancelEvent() outputChatBox("[Admin] " .. getPlayerName(source) .. "#FFFFFF: " .. msg, getRootElement(), 255, 255, 255, true) end end) This one works totally fine. 1 Link to comment
PanBob Posted March 25, 2017 Author Share Posted March 25, 2017 1 hour ago, NeXuS™ said: Are ya in the Admin ACL group? *EDIT* Just found out that a bracket was missing. addEventHandler("onPlayerChat", getRootElement(), function(msg) if (isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin"))) then cancelEvent() outputChatBox("[Admin] " .. getPlayerName(source) .. "#FFFFFF: " .. msg, getRootElement(), 255, 255, 255, true) end end) This one works totally fine. THANKS BRO IT WORK ! +REP 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