Jump to content

Admin prefix problem


shoBy

Recommended Posts

Hey guys! I have a problem with this plugin.

Photo: global.png

When I write in the global chat, I want to appear only one time. There are 11 ranks. Please help me!

Script:

  
-- Global chat
    function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then
            outputChatBox("#FF0000[ADMIN]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
        end
    )
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, aclGetGroup("Co-Owner")) then
            outputChatBox("#FF0000[Co-Owner]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
        end
    )
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, aclGetGroup("Trial")) then
            outputChatBox("#FF0000[Trial Helper]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
        end
    )
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, aclGetGroup("lvl 5")) then
            outputChatBox("#FF0000[super Mod]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
        end
    )
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, aclGetGroup("Owner")) then
            outputChatBox("#FF0000[Admin]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
        end
    )
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, aclGetGroup("lvl 1")) then
            outputChatBox("#FF0000[Helper]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
        end
    )
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then
            outputChatBox("#FF0000[Moderator]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
        end
    )
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, aclGetGroup("lvl 2")) then
            outputChatBox("#FF0000[super Helper]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
        end
    )
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, aclGetGroup("lvl 4")) then
            outputChatBox("#FF0000[Mod]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
        end
    )
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, aclGetGroup("lvl 3")) then
            outputChatBox("#FF0000[Lead Helper]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
        end
    )
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then
            outputChatBox("#FF0000[superModerator]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
Link to comment

You don't want to be using more functions for the same purpose, just use the

  
if -- then 
-- Code 
elseif -- then 
-- Code 
else 
-- Code 
end 
  

You'd have to order things up in the rank order and have it like:

  
if not isObjectInACLGroup(NEXT_GROUP) and isObjectInACLGroup(CURRENT_GROUP) 
  

That will work.

Link to comment

I can't do it better, I think... Is good ?:

  
-- Global chat
    function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, and isObjectInACLGroup ("Admin")) then
            outputChatBox("#FF0000[Owner]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
        end
    )
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account and isObjectInACLGroup ("Co-Owner")) then
            outputChatBox("#FF0000[Co-Owner]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
 
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account and isObjectInACLGroup ("Trial")) then
            outputChatBox("#FF0000[Trial Helper]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
 
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, aclGetGroup("lvl 5")) then
            outputChatBox("#FF0000[super Mod]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
 
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account and isObjectInACLGroup ("Owner")) then
            outputChatBox("#FF0000[Admin]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
 
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account and isObjectInACLGroup ("lvl 1")) then
            outputChatBox("#FF0000[Helper]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
 
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account and isObjectInACLGroup ("Moderator")) then
            outputChatBox("#FF0000[Moderator]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
 
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account and isObjectInACLGroup ("lvl 2")) then
            outputChatBox("#FF0000[super Helper]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
 
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account and isObjectInACLGroup ("lvl 4")) then
            outputChatBox("#FF0000[Mod]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
 
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account and isObjectInACLGroup ("lvl 3")) then
            outputChatBox("#FF0000[Lead Helper]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
 
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account and isObjectInACLGroup ("SuperModerator")) then
            outputChatBox("#FF0000[superModerator]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
Link to comment

Guys, I don't know if this script is good:

  
 
-- Global chat
    function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then
        else -- then
        if not isObjectInACLGroup(NEXT_GROUP) and isObjectInACLGroup(CURRENT_GROUP)
        else -- then
            outputChatBox("#FF0000[Owner]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else -- then
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
        end
    )
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, aclGetGroup("Co-Owner")) then
        else -- then
        if not isObjectInACLGroup(NEXT_GROUP) and isObjectInACLGroup(CURRENT_GROUP)
        else -- then
            outputChatBox("#FF0000[Co-Owner]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else -- then
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
        end
    )
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, aclGetGroup("Trial")) then
        else -- then
        if not isObjectInACLGroup(NEXT_GROUP) and isObjectInACLGroup(CURRENT_GROUP)
        else -- then
            outputChatBox("#FF0000[Trial Helper]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else -- then
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
        end
    )
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, aclGetGroup("lvl 5")) then
        else -- then
        if not isObjectInACLGroup(NEXT_GROUP) and isObjectInACLGroup(CURRENT_GROUP)
        else -- then
            outputChatBox("#FF0000[super Mod]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else -- then
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
        end
    )
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, aclGetGroup("Owner")) then
        else -- then
        if not isObjectInACLGroup(NEXT_GROUP) and isObjectInACLGroup(CURRENT_GROUP)
        else -- then
            outputChatBox("#FF0000[Admin]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else -- then
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
        end
    )
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, aclGetGroup("lvl 1")) then
        else -- then
        if not isObjectInACLGroup(NEXT_GROUP) and isObjectInACLGroup(CURRENT_GROUP)
        else -- then
            outputChatBox("#FF0000[Helper]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else -- then
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
        end
    )
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then
        else -- then
        if not isObjectInACLGroup(NEXT_GROUP) and isObjectInACLGroup(CURRENT_GROUP)
        else -- then
            outputChatBox("#FF0000[Moderator]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else -- then
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
        end
    )
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, aclGetGroup("lvl 2")) then
        else
        if not isObjectInACLGroup(NEXT_GROUP) and isObjectInACLGroup(CURRENT_GROUP)
        else -- then
            outputChatBox("#FF0000[super Helper]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else -- then
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
        end
    )
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, aclGetGroup("lvl 4")) then
        else -- then
        if not isObjectInACLGroup(NEXT_GROUP) and isObjectInACLGroup(CURRENT_GROUP)
        else -- then
            outputChatBox("#FF0000[Mod]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        else -- then
            outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message,root, 255, 255, 255, true)
        end
    end
    addCommandHandler("global",  globalMessage);
     
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
        for index,player in pairs(getElementsByType("player")) do
            bindKey(player,"x", "down", "chatbox", "global");
        end
    end)
     
     
    addEventHandler("onPlayerJoin", getRootElement(),
        function()
            bindKey(source, "x", "down", "chatbox", "global");
        end
    )
     function globalMessage(thePlayer, cmd, ...)
        local message = table.concat ( { ... }, " " );
        local name = getPlayerName(thePlayer);
        local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if
Link to comment
  • Moderators

@shoBy

seriously?

You don't even know what you are doing, aren't you?

You should do the basic things correctly, before you start with the advanced stuff.

Now you are only f.... up your code everytime you edit it.

Yah, sure, thank you. If I can't...

If you don't have time for learning, then stop coding. Wasting your time, wasting our time.

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