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. "El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más". Att: -|TG|-Mister[Q]<.
Anubhav Posted October 14, 2014 Posted October 14, 2014 getElementDimension on onPlayerChat will work asap. See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
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 http://i.imgur.com/CSE28MJ.png Don't hesitate to contact me for anything! If I can help, I will for sure! Education is the most powerful weapon which you can use to change the world. - Castillo
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 MTA Scripters. ♥♥♥Beijinhos♥♥♥
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'). Please do not PM me with scripting related question nor support, use the forums instead.
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 http://i.imgur.com/CSE28MJ.png Don't hesitate to contact me for anything! If I can help, I will for sure! Education is the most powerful weapon which you can use to change the world. - Castillo
Markeloff Posted October 15, 2014 Posted October 15, 2014 getElementDimension on onPlayerChat will work asap. As soon as possible? This is ridiculous. Some people want it to happen, some wish it would happen, others make it happen.
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. Some people want it to happen, some wish it would happen, others make it happen.
xScatta Posted October 15, 2014 Posted October 15, 2014 getElementsInDimension It's fine to celebrate success but it is more important to heed the lessons of failure.
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