MisterQuestions Posted October 14, 2014 Posted October 14, 2014 Hey, can somebody say me if its possible to make chat just visible for players in a dimension, if is on dimension 0 when he chat just be visible for players on dimension 0. and make a global chat to show to all players. doesn't care their dimension.
Anubhav Posted October 14, 2014 Posted October 14, 2014 getElementDimension on onPlayerChat will work asap.
Bonsai Posted October 14, 2014 Posted October 14, 2014 getElementDimension on onPlayerChat will work asap. As soon as possible?
joaosilva099 Posted October 14, 2014 Posted October 14, 2014 You should mantain t chat as the global. And add a handler to a command. When commamd is typed loop through all players and check if they are in same dim. If so output. Tomorrow i can give u the example. Now i am in mobile. U will need addCommandHandler getElementsByType getElementDimension outputChatBox
ZL|LuCaS Posted October 14, 2014 Posted October 14, 2014 (edited) You should mantain t chat as the global. And add a handler to a command. When commamd is typed loop through all players and check if they are in same dim. If so output. Tomorrow i can give u the example. Now i am in mobile. U will need addCommandHandler getElementsByType getElementDimension outputChatBox this? addEventHandler("onPlayerChat",root,function(message, messageType) if messageType == 0 then cancelEvent() local dimLocal = getElementDimension(source) for k,v in ipairs(getElementsByType("player")) do local dimRoot = getElementDimension(v) if dimLocal == dimRoot then outputChatBox(getPlayerName(source)..": #FFFFFF"..message,v,255,255,255,true) outputServerLog("CHAT: "..getPlayerName(source)..": "..message) end end end end) fixed line 6. Edited October 15, 2014 by Guest
DNL291 Posted October 15, 2014 Posted October 15, 2014 this? addEventHandler("onPlayerChat",root,function(message, messageType) if messageType == 0 then cancelEvent() local dimLocal = getElementDimension(source) for k,v in ipairs(getElementsByType("player")) do local dimRoot = getElementDimension(v) if dinLocal == dinRoot then outputChatBox(getPlayerName(source)..": #FFFFFF"..message,v,255,255,255,true) outputServerLog("CHAT: "..getPlayerName(source)..": "..message) end end end end) It has a typo at line 6 ('dinLocal' and 'dinRoot').
joaosilva099 Posted October 15, 2014 Posted October 15, 2014 That would edit 't' chat. I mantain my opinion that you should leave it as the "all dimension" chat. I make you a command that u type like "t/dimchat mensage" and u can bind it on join with bindKey for all players. Just my opinion. EDIT: I didnt saw the return if msgtype = 0. Ok that should work. Forget what i typed above
Markeloff Posted October 15, 2014 Posted October 15, 2014 getElementDimension on onPlayerChat will work asap. As soon as possible? This is ridiculous.
Bonsai Posted October 15, 2014 Posted October 15, 2014 getElementDimension on onPlayerChat will work asap. As soon as possible? This is ridiculous. What you mean?
Markeloff Posted October 15, 2014 Posted October 15, 2014 What you mean? I mean what he said is ridiculous.
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