Janck7 Posted March 15, 2011 Posted March 15, 2011 Hello guys. New on forum. I wrote this script (with help of Zango) : function kontaktadmina (player, cmd, ...) local text = table.concat ({...}, " ") local adminObjects = aclGroupListObjects (aclGetGroup ("Admin")) local admins = {} for k,v in ipairs (getElementsByType ("player")) do if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (v)), aclGetGroup ("Admin")) then outputChatBox ("#FF7F00* Sporocilo od "..getPlayerName (player)..": #FFFF00"..text, v, 255, 255, 0, true) end end outputChatBox ("Message sent.", thePlayer) end addCommandHandler ("Admins", kontaktadmina) addCommandHandler ("admins", kontaktadmina) If you look the last outputchatbox. I want only thePlayer (One who sent message to admin) receive this outputchatbox. Now thePlayer and group Admins get it. Help me please. Thanks for answers!
Janck7 Posted March 15, 2011 Author Posted March 15, 2011 Guys problem solved. I just added 1 more function at the end. Here is the source: function kontaktadmina (player, cmd, ...) local text = table.concat ({...}, " ") local adminObjects = aclGroupListObjects (aclGetGroup ("Admin")) local admins = {} for k,v in ipairs (getElementsByType ("player")) do if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (v)), aclGetGroup ("Admin")) then outputChatBox ("#FF7F00* Sporocilo od "..getPlayerName (player)..": #FFFF00"..text, v, 255, 255, 0, true) end end outputChatBox ("Message sent.", thePlayer) end addCommandHandler ("Admins", kontaktadmina) addCommandHandler ("admins", kontaktadmina) function message (thePlayer, command) outputChatBox ("Message sent!" , thePlayer) end addCommandHandler ("admins", message) addCommandHandler ("Admins", message)
Moderators Citizen Posted March 15, 2011 Moderators Posted March 15, 2011 Or replace thePlayer ( he doesn't defined ) by player like this: function kontaktadmina (player, cmd, ...) local text = table.concat ({...}, " ") local adminObjects = aclGroupListObjects (aclGetGroup ("Admin")) local admins = {} for k,v in ipairs (getElementsByType ("player")) do if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (v)), aclGetGroup ("Admin")) then outputChatBox ("#FF7F00* Sporocilo od "..getPlayerName (player)..": #FFFF00"..text, v, 255, 255, 0, true) end end outputChatBox ("Message sent.", player) end addCommandHandler ("Admins", kontaktadmina) addCommandHandler ("admins", kontaktadmina) It's better than make a second function for the same command
Discord Moderators Zango Posted March 16, 2011 Discord Moderators Posted March 16, 2011 by the way Janck7, you can remove the adminObjects and admins tables, I rewrote the snippet and forgot to clean those lines
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