Jump to content

Help script


Flipi

Recommended Posts

Posted

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 
) 

Posted

You can cancel the original message and send it after all the other messages.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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 
) 

Posted

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.

Posted
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 

Posted
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.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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']

Posted

Sorry, I made a typo, copy the code again.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Seems like you have a custom chat system, so cancelling the message doesn't make any effect.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...