GamerDeMTA Posted April 6, 2013 Share Posted April 6, 2013 (edited) Solved. Edited April 6, 2013 by Guest Link to comment
Castillo Posted April 6, 2013 Share Posted April 6, 2013 outputChatBox("* " .. .." welcome!", source,0,255,0,false) Link to comment
GamerDeMTA Posted April 6, 2013 Author Share Posted April 6, 2013 but I want to put the text says "welcome" Link to comment
GamerDeMTA Posted April 6, 2013 Author Share Posted April 6, 2013 And If i put the otuputchatbox with getRootElement is for all players? getRootElement Link to comment
tosfera Posted April 6, 2013 Share Posted April 6, 2013 If you want to output it for every player, just dont give a source in the outputChatBox; outputChatBox("*".. .. " joined the server, welcome!"); Link to comment
GamerDeMTA Posted April 6, 2013 Author Share Posted April 6, 2013 outputChatBox("* " ..thePlayer.. " Message",getRootElement(),255,0,0,true) And what's wrong with this code? Link to comment
tosfera Posted April 6, 2013 Share Posted April 6, 2013 Did you define the variable; thePlayer in the function? + you can use getRootElement() but its not completely used. You are using thePlayer as a name, so you can also change the getRootElement() to thePlayer or even to source. Cause the source of the event onPlayerJoin/onPlayerLogin = the player element. Link to comment
GamerDeMTA Posted April 6, 2013 Author Share Posted April 6, 2013 Did you define the variable; thePlayer in the function? + you can use getRootElement() but its not completely used. You are using thePlayer as a name, so you can also change the getRootElement() to thePlayer or even to source. Cause the source of the event onPlayerJoin/onPlayerLogin = the player element. This is the full code: [lua] function (thePlayer) local xdd = getPlayerName(thePlayer) outputChatBox("* " ..xdd.. " MESSAGE",getRootElement(),255,0,0,true) end addCommandHandler("OPEN",) Link to comment
tosfera Posted April 6, 2013 Share Posted April 6, 2013 function (thePlayer) local xdd = getPlayerName(thePlayer) outputChatBox("* " ..xdd.. " MESSAGE",getRootElement(),255,0,0,true) end addCommandHandler("OPEN",) Keep it simple; addCommandHandler("open", function(source) local playerName = getPlayerName(source); outputChatBox("* ".. playerName .." MESSAGE", source); end); Link to comment
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