IIIIlllllIII Posted September 6, 2011 Share Posted September 6, 2011 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 Link to comment
IIIIlllllIII Posted September 6, 2011 Author Share Posted September 6, 2011 man im noob in script but we try 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 or no Link to comment
JR10 Posted September 6, 2011 Share Posted September 6, 2011 No, check the wiki's example. Link to comment
BinSlayer1 Posted September 6, 2011 Share Posted September 6, 2011 if isObjectInACLGroup ( "user." .. getPlayerName(source), aclGetGroup ( "Admin" ) ) then if isObjectInACLGroup ( "user." .. getPlayerName(source), aclGetGroup ( "Moderator" ) ) then Link to comment
JR10 Posted September 6, 2011 Share Posted September 6, 2011 if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Admin" ) ) then if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Moderator" ) ) then Link to comment
IIIIlllllIII Posted September 6, 2011 Author Share Posted September 6, 2011 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 Link to comment
Castillo Posted September 6, 2011 Share Posted September 6, 2011 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) Link to comment
Cadu12 Posted September 6, 2011 Share Posted September 6, 2011 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 Link to comment
Castillo Posted September 6, 2011 Share Posted September 6, 2011 I didn't miss anything, I just corrected his code, he didn't had that at all. Link to comment
IIIIlllllIII Posted September 6, 2011 Author Share Posted September 6, 2011 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 Link to comment
Cadu12 Posted September 6, 2011 Share Posted September 6, 2011 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 Link to comment
Castillo Posted September 6, 2011 Share Posted September 6, 2011 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. Link to comment
Cadu12 Posted September 6, 2011 Share Posted September 6, 2011 @Solidsnake14 Missed "SuperModerator" again? Link to comment
JR10 Posted September 6, 2011 Share Posted September 6, 2011 Well, he should edit it to suit him now, add groups etc. We are not his slaves. Link to comment
IIIIlllllIII Posted September 6, 2011 Author Share Posted September 6, 2011 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 Link to comment
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