Jump to content

help with script admin chat box


IIIIlllllIII

Recommended Posts

Posted

hi i have admin script for chat box

when the admin type somehting in the chat box all players see the admin name like

when i type in the chat see this

admin-MOJRM-511

see the code

  
  
addEventHandler ( "onPlayerChat" , root , 
function ( message , type ) 
if hasObjectPermissionTo ( source , "function.banPlayer" ) then 
cancelEvent ( ) 
local r, g, b = getPlayerNametagColor(source) 
outputChatBox ( "#00FF00[Admin]-#ffffff" .. getPlayerName ( source ) .. ":" .. message, getRootElement(), r, g, b, true ) 
end 
end) 
  
  

and all works great

but the problem i cant make script for modrator only admin

if i but function.banPlayer all the admin and modrator in the chat box be admin

i wanna make script for modrator only modrator

when i set function.banPlayer if im admin and modrator i see the same in the chat box

i wanna make it for modrator all the function in the acl admin and acl moderator

pleeeez help me for make this script

i still all my day to make it work for moderator and super modrator

pleeez help me the wiki dont help me

http://mojrm511.x10.mx

msn:

[email protected]

my server ip:

176.9.40.71:22779

-------------------------------------- 2012 updated--------

Posted

man im noob in script but we try :D

do you mean this

for admin

  
  
  
addEventHandler ( "onPlayerChat" , root , 
function ( message , type ) 
if isObjectInACLGroup ( source , "admin" ) then 
cancelEvent ( ) 
local r, g, b = getPlayerNametagColor(source) 
outputChatBox ( "#00FF00[Admin]-#ffffff" .. getPlayerName ( source ) .. ":" .. message, getRootElement(), r, g, b, true ) 
end 
end) 
  
  
  
  
  

for moderator

  
  
  
addEventHandler ( "onPlayerChat" , root , 
function ( message , type ) 
if isObjectInACLGroup ( source , "moderator" ) then 
cancelEvent ( ) 
local r, g, b = getPlayerNametagColor(source) 
outputChatBox ( "#00FF00[Moderator]-#ffffff" .. getPlayerName ( source ) .. ":" .. message, getRootElement(), r, g, b, true ) 
end 
end) 
  
  
  
  
  

did i do the true :D or no

http://mojrm511.x10.mx

msn:

[email protected]

my server ip:

176.9.40.71:22779

-------------------------------------- 2012 updated--------

Posted

if isObjectInACLGroup ( "user." .. getPlayerName(source), aclGetGroup ( "Admin" ) ) then

if isObjectInACLGroup ( "user." .. getPlayerName(source), aclGetGroup ( "Moderator" ) ) then

Posted

this dont working

i test this

  
  
  
  
addEventHandler ( "onPlayerChat" , root , 
function ( message , type ) 
if isObjectInACLGroup ( "user." .. getPlayerName(source), aclGetGroup ( "Moderator" ) ) then 
cancelEvent ( ) 
local r, g, b = getPlayerNametagColor(source) 
outputChatBox ( "#00FF00[Moderator]-#ffffff" .. getPlayerName ( source ) .. ": " .. message, getRootElement(), r, g, b, true ) 
end 
end) 
  

i have erorr in script i test wiki i said wiki dont help me

any one help me pleez

http://mojrm511.x10.mx

msn:

[email protected]

my server ip:

176.9.40.71:22779

-------------------------------------- 2012 updated--------

Posted

That's because you must use the player's account name, not his nick name.

addEventHandler ( "onPlayerChat" , root , 
function ( message , type ) 
if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Moderator" ) ) then 
cancelEvent ( ) 
local r, g, b = getPlayerNametagColor(source) 
outputChatBox ( "#00FF00[Moderator]-#ffffff" .. getPlayerName ( source ) .. ": " .. message, getRootElement(), r, g, b, true ) 
end 
end) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
  
addEventHandler ( "onPlayerChat" , root , 
function ( message , type ) 
if type == 0 then 
if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Moderator" ) ) then 
cancelEvent ( ) 
local r, g, b = getPlayerNametagColor(source) 
outputChatBox ( "#00FF00[Moderator]-#ffffff" .. getPlayerName ( source ) .. ": " .. message, getRootElement(), r, g, b, true ) 
end 
end 
end) 
  

@Solidsnake14 Missed "if type == 0 then" it means we can speak in team

Ingame nick: Cadu12

Posted

I didn't miss anything, I just corrected his code, he didn't had that at all.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

this dos not working

i test it before

when i login with moderator account and when i run the script and see the debugscript 3

i see the msg in debugscript

http://upimg.org/show.php/3237_115891579.bmp.html

see the img

and the script dont work

pleeez fix it all my day trying to make it work

plz

http://mojrm511.x10.mx

msn:

[email protected]

my server ip:

176.9.40.71:22779

-------------------------------------- 2012 updated--------

Posted

LOL, you are not mod, YOU ARE ADMIN they it will error or idk.

edit:

Did you edited in acl.xml? if yes then upload old

Ingame nick: Cadu12

Posted
addEventHandler ( "onPlayerChat", root, 
function ( message, type ) 
if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Moderator" ) ) and type == 0 then 
    cancelEvent ( ) 
    local r, g, b = getPlayerNametagColor(source) 
    outputChatBox ( "#00FF00[Moderator]-#ffffff" .. getPlayerName ( source ) .. ": " .. message, getRootElement(), r, g, b, true ) 
elseif isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Admin" ) ) and type == 0 then    
    cancelEvent ( ) 
    local r, g, b = getPlayerNametagColor(source) 
    outputChatBox ( "#00FF00[Admin]-#ffffff" .. getPlayerName ( source ) .. ": " .. message, getRootElement(), r, g, b, true ) 
    end 
end) 

Works fine here.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
addEventHandler ( "onPlayerChat", root, 
function ( message, type ) 
if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Moderator" ) ) and type == 0 then 
    cancelEvent ( ) 
    local r, g, b = getPlayerNametagColor(source) 
    outputChatBox ( "#00FF00[Moderator]-#ffffff" .. getPlayerName ( source ) .. ": " .. message, getRootElement(), r, g, b, true ) 
elseif isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Admin" ) ) and type == 0 then    
    cancelEvent ( ) 
    local r, g, b = getPlayerNametagColor(source) 
    outputChatBox ( "#00FF00[Admin]-#ffffff" .. getPlayerName ( source ) .. ": " .. message, getRootElement(), r, g, b, true ) 
    end 
end) 

Works fine here.

man you the best thank you so mutch how many time you helping me

you are the king of the scripter

works great thank you my friend you the king of scripter :D

http://mojrm511.x10.mx

msn:

[email protected]

my server ip:

176.9.40.71:22779

-------------------------------------- 2012 updated--------

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