Jump to content

[HELP] me please


Sendy

Recommended Posts

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) 

Link to comment

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 

Link to comment
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

Link to comment
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 

Link to comment
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

Link to comment

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 by Guest
Link to comment
  • 4 weeks later...

It's supposedly works but that it was written into that team chat .. :) It is not about that? :D

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) 

Link to comment

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