Jump to content

Help please...admin plugin


shoBy

Recommended Posts

Hey guys...I tryed to make an admin plugin with ranks like : Owner, Co-Owner, Lead Admn, Admin, Moderator, Helper and Trial Helper...It doesn't work and I don't know how to make it work and I need your help...Please create one for me, or where I need to edit in acl.xml or anything to make it :| I need a plugin with prefix rank like: I am owner, so I want to change my name on Globalchat [Owner]shoBy (no [Global]). Please help me guys :o3

Link to comment

I made a code for someone. You can use it ;)

  
local groups = {  
 {"Admin", "#FF0000*[ Admin ]*"}, 
{"Mode","#00FF00*[ Moderator ]*"} , 
{"vip","#ffff00*[ V.I.P ]*"} ,  
 {"Owner","#A000FF*[ Owner ]*"},   
{"SubAdmin","#0000ff*[ Sub Admin ]*"},  
{"Everyone", "[ Everyone ]"} 
 } 
  
local function RGBToHex(red, green, blue, alpha) 
    if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then 
        return nil 
    end 
    if(alpha) then 
        return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) 
    else 
        return string.format("#%.2X%.2X%.2X", red,green,blue) 
    end 
end 
  
addEventHandler ( "onPlayerChat", root, 
function ( msg, type ) 
    if type == 0 then  
    for i,v in pairs ( groups ) do  
      if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( v[1] ) ) then 
        cancelEvent ( ) 
        local r, g, b = getPlayerNametagColor(source) 
        outputChatBox ( v[2].. " "..RGBToHex(r,g,b) .. getPlayerName ( source ) .. ":#FFFFFF " .. msg, getRootElement(),255,255,255, true ) 
  
                    break  
                 end 
             end 
        end 
    end 
) 
  

EDIT: If you see 2 outputs then that means play or freeroam is running.

Edited by Guest
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...