Jump to content

How to do this outputchatbox? Also..


GamerDeMTA

Recommended Posts

-- Server Side --

addEventHandler("onPlayerCommand",root, 
    function ( theCmd ) 
            if ( theCmd == "Money" ) then 
                outputChatBox(" You're Money : ("..getPlayerMoney( source )..") !!!",source,0,255,0,true); 
                    elseif ( theCmd == "Ping" ) then 
                        outputChatBox(" You're Ping : ("..getPlayerPing( source )..") !!!",source,255,255,0,true); 
        end 
    end 
); 

How does it work?

just type the command "Money" or the command "Ping" in the console and will work try it server sid (;

Link to comment
-- Server Side --

addEventHandler("onPlayerCommand",root, 
    function ( theCmd ) 
            if ( theCmd == "Money" ) then 
                outputChatBox(" You're Money : ("..getPlayerMoney( source )..") !!!",source,0,255,0,true); 
                    elseif ( theCmd == "Ping" ) then 
                        outputChatBox(" You're Ping : ("..getPlayerPing( source )..") !!!",source,255,255,0,true); 
        end 
    end 
); 

How does it work?

just type the command "Money" or the command "Ping" in the console and will work try it server sid (;

And if I want to put it if a player says a message like "showping" instead a command?

Link to comment
addEventHandler ( "onPlayerChat", root, 
    function ( message ) 
        if ( message == "showping" ) then 
            outputChatBox ( getPlayerPing ( source ), source ) 
            cancelEvent ( ) 
        end 
    end 
) 

Link to comment

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