Jump to content

[HELP] Removing the ACL Login Message - SOLVED


TheGamingMann

Recommended Posts

I have a custom login in message and login panel. Could you help me disable or silence the "ACL: You have logged in" message please. Thank you. Here is my code.

c_login.lua:

function createRegister() 
    local screenW, screenH = guiGetScreenSize() 
    wdwAccount = guiCreateWindow((screenW - 378) / 2, (screenH - 109) / 2, 378, 109, "", false) 
    guiWindowSetSizable(wdwAccount, false) 
    lblPassword = guiCreateLabel(10, 37, 102, 15, "Enter a Password", false, wdwAccount) 
    guiSetFont(lblPassword, "default-bold-small") 
    edtInfo = guiCreateEdit(127, 33, 240, 24, "", false, wdwAccount) 
    guiEditSetMasked(edtInfo, true) 
    btnSubmit = guiCreateButton(112, 67, 153, 30, "Submit", false, wdwAccount) 
     
    addEventHandler("onClientGUIClick", btnSubmit, accRequest, false) 
end 
  
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), 
    function() 
        createRegister() 
        guiSetVisible(wdwAccount, false) 
        showRegister() 
    end 
) 
  
function showRegister() 
    if not guiGetVisible(wdwAccount) then 
        guiSetVisible(wdwAccount, true) 
        showCursor(true, true) 
    end 
end 
  
function hideRegister() 
    guiSetVisible(wdwAccount, false) 
    showCursor(false, false) 
    triggerEvent("showSpawnWindow", localPlayer) 
end 
addEvent("hideLoginWindow", true) 
addEventHandler("hideLoginWindow", localPlayer, hideRegister) 
  
function accRequest() 
    local password = guiGetText(edtInfo) 
    triggerServerEvent("accLogReg", localPlayer, password) 
end 

s_login.lua:

function loginHandler(password) 
    local account = getAccount(getPlayerName(source), password) 
        if (account ~= false) then 
            logIn(source, account, password) 
            outputChatBox("Welcome back "..getPlayerName(source)..".", source, 102, 40, 2) 
            triggerClientEvent("hideLoginWindow", source) 
        else 
            if (password ~= "" and password ~= nil) then 
                local accountAdded = addAccount(getPlayerName(source), password) 
                if (accountAdded) then 
                    outputChatBox("Thank you for registering "..getPlayerName(source)..".", source, 102, 40, 2) 
                    outputChatBox("If you click 'Submit' again you can login.", source, 102, 40, 2) 
                end 
            end 
        end 
    end 
addEvent("accLogReg", true) 
addEventHandler("accLogReg", root, loginHandler) 

Thanks in advanced for any help guys. Also sorry if I am a bit "Annoying".

-Fixed

Edited by Guest
Link to comment

As far as I know, you can't remove it, unless maybe if you use onChatMessage, and check to see if the message is equal to the login message, then cancel it out... Maybe that would work, but i'm not really sure. So something like this:

addEventHandler ( "onChatMessage", root, function ( msg )  
    if ( tostring ( msg ) : lower ( ) == "login: you successfully logged in" ) then 
        cancelEvent ( ) 
    end  
end ) 

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