Dentos Posted August 2, 2014 Share Posted August 2, 2014 its for global chat want to edit there table.concat with there rank any help much appreciated (sorry im kinda new) function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ) local name = getPlayerName(thePlayer) if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Admin" ) ) then outputChatBox("#ad515a[Global]"..name..": #FDFDFD"..message, getRootElement(), 255, 255, 255, true) if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Moderator" ) ) then outputChatBox("#ad515a[Moderator]"..name..": #FDFDFD"..message, getRootElement(), 255, 255, 255, true) if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "SuperModerator" ) ) then outputChatBox("#ad515a[superModerator]"..name..": #FDFDFD"..message, getRootElement(), 255, 255, 255, true) else outputChatBox("#ad515a[Global]"..name..": #FDFDFD"..message, getRootElement(), 255, 255, 255, true) end end end end addCommandHandler("global", globalMessage) Link to comment
Anubhav Posted August 2, 2014 Share Posted August 2, 2014 function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ) local name = getPlayerName(thePlayer) if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Admin" ) ) then outputChatBox("#ad515a[Global]"..name..": #FDFDFD"..message, getRootElement(), 255, 255, 255, true) end if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Moderator" ) ) then outputChatBox("#ad515a[Moderator]"..name..": #FDFDFD"..message, getRootElement(), 255, 255, 255, true) end if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "SuperModerator" ) ) then outputChatBox("#ad515a[superModerator]"..name..": #FDFDFD"..message, getRootElement(), 255, 255, 255, true) else outputChatBox("#ad515a[Global]"..name..": #FDFDFD"..message, getRootElement(), 255, 255, 255, true) end end addCommandHandler("global", globalMessage) Link to comment
Dentos Posted August 3, 2014 Author Share Posted August 3, 2014 annubav i thinks somethings wrong with fuction but not sure Link to comment
Gr0x Posted August 3, 2014 Share Posted August 3, 2014 function globalMessage(source, cmd, ...) local message = table.concat ( { ... }, " " ) local name = getPlayerName(source) if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Admin" ) ) then outputChatBox("#ad515a[Admin]"..name..": #FDFDFD"..message, getRootElement(), 255, 255, 255, true) -- You wrote Global here, but i think you wanted Admin. return end if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Moderator" ) ) then outputChatBox("#ad515a[Moderator]"..name..": #FDFDFD"..message, getRootElement(), 255, 255, 255, true) return end if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "SuperModerator" ) ) then outputChatBox("#ad515a[superModerator]"..name..": #FDFDFD"..message, getRootElement(), 255, 255, 255, true) return end outputChatBox("#ad515a[Global]"..name..": #FDFDFD"..message, getRootElement(), 255, 255, 255, true) end addCommandHandler("global", globalMessage) 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