Sendy Posted May 27, 2014 Posted May 27, 2014 Please help me make it work for Local Chat Global Chat, Team Chat? please .. when he wrote to the Local so I wrote it there as well as if they got it in play gamemode .. now it's in my DayZ gamemode. addEventHandler ( "onPlayerChat", root, function ( message, type ) if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "VIP" ) ) and type == 0 then cancelEvent ( ) local r, g, b = getPlayerNametagColor(source) outputChatBox ( "##FFFF00-VIP- #FFFF00 " .. getPlayerName(source) .. ":#FFFF00 " .. message, getRootElement(), r, g, b, true ) end end)
xXMADEXx Posted May 27, 2014 Posted May 27, 2014 You could do something like this: addEventHandler ( "onPlayerChat", root, function ( msg, tp ) cancelEvent ( ) if ( tp == 0 ) then outputLocalMessage ( source, msg, "global" ) elseif ( tp ==2 ) then outputLocalMessage ( source, msg, "team" ) end end ) function outputLocalMessage ( player, message, tp ) if ( tp == "global" ) then -- this would be gobal chat elseif( tp == "team" ) then -- this is the team chat end end
Sendy Posted May 27, 2014 Author Posted May 27, 2014 You could do something like this: addEventHandler ( "onPlayerChat", root, function ( msg, tp ) cancelEvent ( ) if ( tp == 0 ) then outputLocalMessage ( source, msg, "global" ) elseif ( tp ==2 ) then outputLocalMessage ( source, msg, "team" ) end end ) function outputLocalMessage ( player, message, tp ) if ( tp == "global" ) then -- this would be gobal chat elseif( tp == "team" ) then -- this is the team chat end end Perhaps you misunderstood me .. I wanted to do-VIP-wrote into global chat, local chat, team chat
Chronic Posted May 27, 2014 Posted May 27, 2014 addEventHandler ( "onPlayerChat", root, function ( msg, tp ) cancelEvent ( ) if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "VIP" ) ) then if ( tp == 0 ) then outputLocalMessage ( source, msg, "global" ) elseif ( tp ==2 ) then outputLocalMessage ( source, msg, "team" ) end end end ) function outputLocalMessage ( player, message, tp ) if ( tp == "global" ) then outputChatBox ( "[VIP]"..getPlayerName(player)..": "..message ) -- this would be gobal chat elseif( tp == "team" ) then -- this is the team chat end end
Sendy Posted May 27, 2014 Author Posted May 27, 2014 addEventHandler ( "onPlayerChat", root, function ( msg, tp ) cancelEvent ( ) if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "VIP" ) ) then if ( tp == 0 ) then outputLocalMessage ( source, msg, "global" ) elseif ( tp ==2 ) then outputLocalMessage ( source, msg, "team" ) end end end ) function outputLocalMessage ( player, message, tp ) if ( tp == "global" ) then outputChatBox ( "[VIP]"..getPlayerName(player)..": "..message ) -- this would be gobal chat elseif( tp == "team" ) then -- this is the team chat end end That's not all the time .. and not write at all in global chat, group chat, or local chat, simply as if it is a gamemode play
#RooTs Posted May 27, 2014 Posted May 27, 2014 (edited) Server.lua addEventHandler ( "onPlayerChat", root, function ( message, type ) if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Vip" ) ) and type == 0 then cancelEvent ( ) local r, g, b = getPlayerNametagColor(source) outputChatBox ( "#FFFFFF*[ #000FFFVip#FFFFFF ]- " .. getPlayerName(source) .. ": " .. message, getRootElement(), r, g, b, true ) end end) Edited May 27, 2014 by Guest
Sendy Posted May 27, 2014 Author Posted May 27, 2014 you want it? Yes but that it was in Group chat, chat Local - DayZ, and global chat
#RooTs Posted May 27, 2014 Posted May 27, 2014 is tricky to do that I can no longer help you the user (Chronic) and (xXMADEXx) is more experienced Sorry my friend
xXMADEXx Posted May 27, 2014 Posted May 27, 2014 Well, DayZ uses a custom chat resource, so you'll have to get the source code (legally) to edit it.
Sendy Posted May 28, 2014 Author Posted May 28, 2014 Well, DayZ uses a custom chat resource, so you'll have to get the source code (legally) to edit it. And the group chat, local chat and this is not what I give global chat?
Sendy Posted June 23, 2014 Author Posted June 23, 2014 It's supposedly works but that it was written into that team chat .. It is not about that? addEventHandler ( "onPlayerChat", root, function ( message, type ) if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "VIP" ) ) and type == 0 then cancelEvent ( ) local r, g, b = getPlayerNametagColor(source) outputChatBox ( "#FFFF00-VIP- " .. getPlayerName(source) .. ": " .. message, getRootElement(), r, g, b, true ) end end)
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