Jump to content

Chat for players in dimension


Recommended Posts

Posted

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

Posted

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 

350x20_FFFFFF_FFFFFF_000000_000000.png

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

Posted (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 by Guest

MTA Scripters. ♥♥♥Beijinhos♥♥♥

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

Posted

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

350x20_FFFFFF_FFFFFF_000000_000000.png

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

Posted
getElementDimension on onPlayerChat will work asap.

As soon as possible?

This is ridiculous.

430x73_B2E03D_FF9900_000000_000000.png

Some people want it to happen, some wish it would happen, others make it happen.

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