Jump to content

How can i fix this


nick1995

Recommended Posts

It is a admintag script

I want that every admin get [ADMIN] for his name except Damian.

This is the script:

function chatbox(text, msgtype) 
local root = getRootElement() 
local account = getAccountName(getPlayerAccount(source)) 
local name = getPlayerName(source) 
if (msgtype == 0) then 
    if isObjectInACLGroup("user." .. account, aclGetGroup("Nick en Mitchel")) then 
     cancelEvent(true) 
        outputChatBox("#FF0000[Owner]  #FFFFFF" .. name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) 
        outputServerLog("CHAT: [Owner] " .. name .. ": " .. text) 
         
    elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) and name =! "damian"    then 
     cancelEvent(true) 
        outputChatBox("#855863[ADMIN]  #FFFFFF" .. name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) 
        outputServerLog("CHAT: [ADMIN] " .. name .. ": " .. text) 
        
    elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then 
     cancelEvent(true) 
        outputChatBox("#855863[sMOD]  #FFFFFF" .. name ..":#FFFFFF " .. text, root, 255, 255, 255, true) 
        outputServerLog("CHAT: [sMOD] " .. name .. ": " .. text) 
        
    elseif isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then 
     cancelEvent(true) 
        outputChatBox("#855863[MOD]  #FFFFFF" .. name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) 
        outputServerLog("CHAT: [MOD] " .. name .. ": " .. text) 
  
    elseif isObjectInACLGroup("user." .. account, aclGetGroup("Everyone")) then 
     cancelEvent(true) 
        outputChatBox(name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) 
        outputServerLog("CHAT: " .. name .. ": " .. text) 
        end 
  
elseif (msgtype == 2) then 
  
end 
end 
addEventHandler("onPlayerChat", root, chatbox) 
  
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 

Link to comment
function chatbox(text, msgtype) 
local root = getRootElement() 
local account = getAccountName(getPlayerAccount(source)) 
local name = getPlayerName(source) 
if (msgtype == 0) then 
    if isObjectInACLGroup("user." .. account, aclGetGroup("Nick en Mitchel")) then 
     cancelEvent(true) 
        outputChatBox("#FF0000[Owner]  #FFFFFF" .. name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) 
        outputServerLog("CHAT: [Owner] " .. name .. ": " .. text) 
        
    elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) and name ~= "damian"    then 
     cancelEvent(true) 
        outputChatBox("#855863[ADMIN]  #FFFFFF" .. name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) 
        outputServerLog("CHAT: [ADMIN] " .. name .. ": " .. text) 
        
    elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then 
     cancelEvent(true) 
        outputChatBox("#855863[sMOD]  #FFFFFF" .. name ..":#FFFFFF " .. text, root, 255, 255, 255, true) 
        outputServerLog("CHAT: [sMOD] " .. name .. ": " .. text) 
        
    elseif isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then 
     cancelEvent(true) 
        outputChatBox("#855863[MOD]  #FFFFFF" .. name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) 
        outputServerLog("CHAT: [MOD] " .. name .. ": " .. text) 
  
    elseif isObjectInACLGroup("user." .. account, aclGetGroup("Everyone")) then 
     cancelEvent(true) 
        outputChatBox(name .. ":#FFFFFF " .. text, root, 255, 255, 255, true) 
        outputServerLog("CHAT: " .. name .. ": " .. text) 
        end 
  
elseif (msgtype == 2) then 
  
end 
end 
addEventHandler("onPlayerChat", root, chatbox) 
  
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 

You have to use: "~=".

Link to comment
i think he want like this
addEventHandler('onClientResourceStart', resourceRoot, 
function(uPlayer) 
if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) and getPlayerName(uPlayer) == 'damian' then 
end 
end) 

nice joke

lol

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