Jump to content

Can someone help me with this?


GamerDeMTA

Recommended Posts

What's wrong with these lines?

outputChatBox("You're in "..getTeamName( source ).. " team  "..getPlayerName( source ).. "",root,255,255,255,true) 

Also I want to do a table with outputchatboxs with TRUE AND ALSO 255, 255, 255 THOSE THINGS. I can without it, but with it it gives error.

setTimer ( function ( ) 
    outputChatBox ( tabl[math.random(#tabll)] ) 
end, 10000, 0 ) 

What I should do?

Link to comment
Try:
outputChatBox("You're in "..getTeamName( getPlayerTeam ( source ) ).. " team  "..getTeamName( getPlayerTeam ( source ) ),root,255,255,255,true) 

He put the name of the player in the end.

outputChatBox("You're in "..getTeamName( getPlayerTeam ( source ) ).. " team  "..getPlayerName( source ),root,255,255,255,true) 

Link to comment
setTimer ( 
    function ( ) 
        outputChatBox ( tabl [ math.random ( #tabll ) ], 255, 255, 255, true ) 
    end 
    ,10000, 0 
) 

It doesn't work :(

Also when I type the command for my other commands like this:

addEventHandler ( "onPlayerChat", root, 
    function ( message ) 
        if ( message == "players" ) then 
            outputChatBox("we are "..getPlayerCount( source ).. " players",root,255,255,0,true) 
            cancelEvent ( ) 
        end 
    end 
) 

It shows the message before I say that :(((( I mean this happened, I say players[/ban] and...

Me: players

we are 1 players

It happened... That PLease Help

Link to comment

That code is client side, if you want to do it server side, you must fill the visibleTo argument.

setTimer ( 
    function ( ) 
        outputChatBox ( tabl [ math.random ( #tabl ) ], root, 255, 255, 255, true ) 
    end 
    ,10000, 0 
) 

Link to comment
setTimer ( 
    function ( ) 
        outputChatBox ( tabl [ math.random ( #tabll ) ], 255, 255, 255, true ) 
    end 
    ,10000, 0 
) 

It doesn't work

Also when I type the command for my other commands like this:

addEventHandler ( "onPlayerChat", root, 
    function ( message ) 
        if ( message == "players" ) then 
            outputChatBox("we are "..getPlayerCount( source ).. " players",root,255,255,0,true) 
            cancelEvent ( ) 
        end 
    end 
) 

It shows the message before I say that :(((( I mean this happened, I say players[/ban] and...

Me: players

we are 1 players

It happened... That PLease Help

getPlayerCount haven't arguments so delete "source".

Link to comment

Ok but help me with this! When I type "ping" it shows the outputChatBox two times!

addEventHandler ( "onPlayerChat", root, 
    function ( message ) 
        if ( message == "ping" ) then 
            outputChatBox("your ping: "..getPlayerPing( source ).. " \"{SMILIES_PATH}/icon_biggrin.gif\" alt=\"\" title=\"Very Happy\" />",root,255,255,0,true) 
            cancelEvent ( ) 
        end 
    end 
) 

Why???

Link to comment

Make Sure Freeroam is Off and Try This ,

addEventHandler('onPlayerCommand', root, 
function ( cmd ) 
    if ( cmd ) == 'ping'  then 
    cancelEvent ( ) 
    outputChatBox('Your Ping'.. getPlayerName(source), root, 255, 255, 0 , true) 
 end 
end 
)     

Link to comment
Make Sure Freeroam is Off and Try This ,
addEventHandler('onPlayerCommand', root, 
function ( cmd ) 
    if ( cmd ) == 'ping'  then 
    cancelEvent ( ) 
    outputChatBox('Your Ping'.. getPlayerName(source), root, 255, 255, 0 , true) 
 end 
end 
)     

Freeroam isn't running :S But I want to do it if player says "ping" not with a command. Please help

Link to comment
addEventHandler('onPlayerChat', root, -- When player sends the message in chatbox 
    function ( msg ) 
        if ( msg ) == 'ping'  then -- if message was "ping" then 
            cancelEvent ( ) -- don't show the message 
            outputChatBox(getPlayerName(source) .. "'s ping is: " .. getPlayerPing (source), root, 255, 255, 0 , true) -- Output player's name and ping 
        end 
    end 
)     

Link to comment

Try this:

addEventHandler('onPlayerChat', root, -- When player sends the message in chatbox 
    function ( msg, msgT ) 
        if msg  == 'ping' and msgT == 1 then -- if message was "ping" then 
            cancelEvent ( ) -- don't show the message 
            outputChatBox(getPlayerName(source) .. "'s ping is: " .. getPlayerPing (source), root, 255, 255, 0 , true) -- Output player's name and ping 
        end 
    end 
)     

Link to comment
Try:
outputChatBox("You're in "..getTeamName( getPlayerTeam ( source ) ).. " team  "..getTeamName( getPlayerTeam ( source ) ),root,255,255,255,true) 

He put the name of the player in the end.

outputChatBox("You're in "..getTeamName( getPlayerTeam ( source ) ).. " team  "..getPlayerName( source ),root,255,255,255,true) 

oh, didn't see that. Sorry. Thanks for fixing it.

Link to comment
Try this:
addEventHandler('onPlayerChat', root, -- When player sends the message in chatbox 
    function ( msg, msgT ) 
        if msg  == 'ping' and msgT == 1 then -- if message was "ping" then 
            cancelEvent ( ) -- don't show the message 
            outputChatBox(getPlayerName(source) .. "'s ping is: " .. getPlayerPing (source), root, 255, 255, 0 , true) -- Output player's name and ping 
        end 
    end 
)     

Now it doesn't work ._. Pls someone help!!!

Link to comment

Sorry change:

if msg  == 'ping' and msgT == 1 then  

to

if msg  == 'ping' and msgT == 0 then  

And check in the meta that the type script is server. Execute command debugscript 3 on game to see if it has error.

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