Flipi Posted October 25, 2013 Posted October 25, 2013 Hi, How do for the command "!rules" appears on the bottom of posts? I explain it right? image: http://img35.imageshack.us/img35/402/wchm.png addEventHandler("onPlayerChat",getRootElement(), function(message,messageType) if message == "!reglas" then outputChatBox ( "* #FF80001) #0080FFmessage 1",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80002) #0080FFmessage 2",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80003) #0080FFmessage 3",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80004) #0080FFmessage 4",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80005) #0080FFmessage 5",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80006) #0080FFmessage 6",getRootElement(), 255, 255, 255, true ) end end )
Castillo Posted October 25, 2013 Posted October 25, 2013 You can cancel the original message and send it after all the other messages. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Flipi Posted October 25, 2013 Author Posted October 25, 2013 You can cancel the original message and send it after all the other messages. and how do I do that?
Castillo Posted October 25, 2013 Posted October 25, 2013 Cancel the original message using: cancelEvent, then just send anothr message using outputChatBox. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Flipi Posted October 25, 2013 Author Posted October 25, 2013 Cancel the original message using: cancelEvent, then just send anothr message using outputChatBox. in this part? if message == "!reglas" then addEventHandler("onPlayerChat",getRootElement(), function(message,messageType) if message == "!reglas" then outputChatBox ( "* #FF80001) #0080FFmessage 1",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80002) #0080FFmessage 2",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80003) #0080FFmessage 3",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80004) #0080FFmessage 4",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80005) #0080FFmessage 5",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80006) #0080FFmessage 6",getRootElement(), 255, 255, 255, true ) end end )
Dealman Posted October 25, 2013 Posted October 25, 2013 I think what Solidsnake14 said is that you use cancelEvent. You then output the messages with the rules at the bottom. So yes, in that part. If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.
Flipi Posted October 25, 2013 Author Posted October 25, 2013 I think what Solidsnake14 said is that you use cancelEvent. You then output the messages with the rules at the bottom. So yes, in that part. something like this could be? addEventHandler("onPlayerChat",getRootElement(), function(message,messageType) cancelEvent () if message == "!reglas" end then outputChatBox ( "* #FF80001) #0080FFmessage 1",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80002) #0080FFmessage 2",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80003) #0080FFmessage 3",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80004) #0080FFmessage 4",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80005) #0080FFmessage 5",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80006) #0080FFmessage 6",getRootElement(), 255, 255, 255, true ) end end
Castillo Posted October 25, 2013 Posted October 25, 2013 addEventHandler ( "onPlayerChat", getRootElement(), function ( message,messageType ) if ( message == "!reglas" ) then outputChatBox ( "* #FF80001) #0080FFmessage 1",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80002) #0080FFmessage 2",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80003) #0080FFmessage 3",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80004) #0080FFmessage 4",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80005) #0080FFmessage 5",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80006) #0080FFmessage 6",getRootElement(), 255, 255, 255, true ) local r, g, b = getPlayerNametagColor ( source ) outputChatBox ( getPlayerName ( source ) ..": #FFFFFF".. message, root, r, g, b, true ) cancelEvent ( ) end end ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Flipi Posted October 25, 2013 Author Posted October 25, 2013 addEventHandler ( "onPlayerChat", getRootElement(), function ( message,messageType ) if ( message == "!reglas" ) then outputChatBox ( "* #FF80001) #0080FFmessage 1",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80002) #0080FFmessage 2",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80003) #0080FFmessage 3",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80004) #0080FFmessage 4",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80005) #0080FFmessage 5",getRootElement(), 255, 255, 255, true ) outputChatBox ( "* #FF80006) #0080FFmessage 6",getRootElement(), 255, 255, 255, true ) local r, g, b = getPlayerNametagColor ( source ) outputChatBox ( getPlayerName ( source ) ..": #FFFFFF".. message, r, g, b, true ) cancelEvent ( ) end end ) I appears an error: WARNING: reglas\reglas.lua:11: Bad argument @ 'outputChatBox' [Expected element at argument 2, got number '255']
Castillo Posted October 25, 2013 Posted October 25, 2013 Sorry, I made a typo, copy the code again. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Flipi Posted October 25, 2013 Author Posted October 25, 2013 Sorry, I made a typo, copy the code again. the problem is that now appears twice image: http://img96.imageshack.us/img96/1648/84ke.png
Castillo Posted October 25, 2013 Posted October 25, 2013 Seems like you have a custom chat system, so cancelling the message doesn't make any effect. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Flipi Posted October 25, 2013 Author Posted October 25, 2013 Seems like you have a custom chat system, so cancelling the message doesn't make any effect. ahh ok thanks
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