-.Paradox.- Posted July 24, 2013 Posted July 24, 2013 Hello, i have this script, its working fine but one thing is missing, When admin do /shoutall "msg" the message must appear in chatbox like that, SHOUTALL:"msg" here is the code function shout(player, cmd, ...) local accountname = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" )) then for id, players in ipairs(getElementsByType("player")) do local message = table.concat({...}," ") local textDisplay = textCreateDisplay () local nombre = getPlayerName(player) local textItem = textCreateTextItem( ""..message, 0.5, 0.5, 2, 205, 0, 0, 255, 3, "center", "center" ) textDisplayAddText ( textDisplay, textItem ) textDisplayAddObserver ( textDisplay, players ) setTimer ( textDestroyTextItem, 5000, 1, textItem ) setTimer ( textDestroyDisplay, 5000, 1, textDisplay ) end else outputChatBox("You cannot use this command!",player,255,12,15) end end addCommandHandler("SHOUTALL", shout) Thanks for help If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Castillo Posted July 24, 2013 Posted July 24, 2013 function shout ( player, cmd, ... ) local accountname = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then local message = table.concat ( { ... }," " ) outputChatBox ( "SHOUTALL: ".. message, root, 205, 0, 0 ) else outputChatBox ( "You cannot use this command!", player, 255, 12, 15 ) end end addCommandHandler ( "SHOUTALL", shout ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted July 24, 2013 Author Posted July 24, 2013 Thanks working fine If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Castillo Posted July 24, 2013 Posted July 24, 2013 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted July 24, 2013 Author Posted July 24, 2013 Worked fine. but when i restarted server it wont show The message, it show only in chat box. Thanks for youre help If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Castillo Posted July 24, 2013 Posted July 24, 2013 I don't understand. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted July 24, 2013 Author Posted July 24, 2013 It wont show the message in screen, but it show in the chatbox. If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Castillo Posted July 24, 2013 Posted July 24, 2013 Isn't that what you wanted? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted July 24, 2013 Author Posted July 24, 2013 nope i want it to show in screen & chatbox. If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Castillo Posted July 24, 2013 Posted July 24, 2013 function shout ( player, cmd, ... ) local accountname = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then local message = table.concat ( { ... }," " ) textDisplay = textCreateDisplay ( ) outputChatBox ( "SHOUTALL: ".. message, root, 205, 0, 0 ) textItem = textCreateTextItem ( message, 0.5, 0.5, 2, 205, 0, 0, 255, 3, "center", "center" ) textDisplayAddText ( textDisplay, textItem ) for _, thePlayer in ipairs ( getElementsByType ( "player" ) ) do textDisplayAddObserver ( textDisplay, thePlayer ) end setTimer ( function ( ) textDestroyTextItem ( textItem ) textDestroyDisplay ( textDisplay ) end ,5000, 1 ) else outputChatBox ( "You cannot use this command!", player, 255, 12, 15 ) end end addCommandHandler ( "SHOUTALL", shout ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted July 24, 2013 Author Posted July 24, 2013 Warning: Shoutall/shoutall.lua:14: Bad argument@ 'testDisplayAddObServer' If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
Castillo Posted July 24, 2013 Posted July 24, 2013 Copy it again. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted July 24, 2013 Author Posted July 24, 2013 Working perfect thanks If you're looking for a cheap paid scripter, don't hesitate to contact me. Great minds discuss ideas, Average minds discuss events and small minds discuss people.
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