Jump to content

onplayerchat admin msg need help


IIIIlllllIII

Recommended Posts

Posted

hi i wanna make some script like when the admin type anything in the chat box all player see the admin

like when i type in chat box i see like this

admin-MOJRM-511

or

modrator-MOJRM-511

i mean in the chat box and i have this code pleez fix it

  
  
function onChat ( message, messageType ) 
    if messageType == 0 then 
        local root = getRootElement() 
        outputChatBox ( getPlayerName ( source ) .. "#ff0000admin: " .. message, getRootElement() ) 
        cancelEvent() 
        outputServerLog( "#ff0000admin: " .. getPlayerName ( source ).. "#ff0000admin: " .. message ) 
    end 
end 
addEventHandler ( "onPlayerChat", getRootElement(), onChat ) 
  

Posted
you just copy paste it from wiki after you check the messageType check the player acl group and if is admin then .. and if is modelator then ..

ok if you know the code pleez put your code here

im noob i dont know what you mean give me ur code and i take it

Posted

i don't have this code i don't need it and this is not a request forum (bk you need it i will not make it i have my own things to do .. ) make a part of code and we will correct the mistakes

Posted
addEventHandler ( "onPlayerChat" , root , 
function ( message , type ) 
if hasObjectPermissionTo ( source , "function.banPlayer" ) then 
cancelEvent ( ) 
outputChatBox ( "#ff0000admin " .. getPlayerName ( source ) .. " : " .. message, getRootElement() ) 
end 
end) 

And yeah, this is not a request forum, I just had time, next time try something yourself.

Posted

back

when i try this code

  
  
addEventHandler ( "onPlayerChat" , root , 
function ( message , type ) 
if hasObjectPermissionTo ( source , "function.banPlayer" ) then 
cancelEvent ( ) 
outputChatBox ( "#ff0000admin" .. getPlayerName ( source ) .. ":" .. message, getRootElement() ) 
end 
end) 
  
  
  
  

i dont see the color not working

115793xiqds.JPG

all works great but

i dont see the color when i put #ff0000 red color

the problem with the color not working

fix it pleeez

Posted

That's because the color codes aren't enabled.

addEventHandler ( "onPlayerChat" , root , 
function ( message , type ) 
if hasObjectPermissionTo ( source , "function.banPlayer" ) then 
cancelEvent ( ) 
local r, g, b = getPlayerNametagColor(source) 
outputChatBox ( "#ff0000admin" .. getPlayerName ( source ) .. ":" .. message, getRootElement(), r, g, b, true ) 
end 
end) 

Posted

You say that now, but in another topic you said this:

"you too i dont know anything of what you say

^_^

your english too man lett me understand you"

Posted
You say that now, but in another topic you said this:

"you too i dont know anything of what you say

^_^

your english too man lett me understand you"

hahaha man dont be angry i kidding with you

we not english i mean you and me maybe sometime we have a problem with english

dont angry i kidding

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