1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. GTA Network forum is now in archive mode.

SOLVED: Close CEF window after login

Discussion in 'Archive' started by Dane, Apr 25, 2017.

Tags:
  1. Dane

    Dane Member

    Messages:
    17
    Likes Received:
    1
    Joined:
    Apr 20, 2017
    Hey, I'm trying to create a CEF login/register. But somehow the CEF shows but can't be closed after logging into an account.

    I've created a CEF file which looks like this: https://pastebin.gtanet.work/?7ab3afaac3766904#9tn9IeyyQfYPmdyzPjWY0lpx4tWss5FVWv0kGOXkvKw=

    Now I'm creating the CEF inside the public void onPlayerDownload(Client player) function using:

    API.triggerClientEvent(player, "startUp");

    But once I'm done checking if the password and username matches any records inside the
    public void OnClientEvent(Client player, string eventName, params object[] arguments)
    function, the following clientevent won't close the CEF panel:

    API.triggerClientEvent(player, "KillPanel");

    Does someone know what I'm doing wrong?

    Extra information:

    If i create the cefLogin function inside the CEF file in the following way:

    Code:
    function cefLogin(password)
    {
        var response = API.triggerServerEvent("loginUser", password);
    
        if (cef !== null)
        {
            cef.destroy();
            cef = null;
        }
    }
    
    

    then the CEF closes. I appreciate any kind of help.
     
    Last edited by a moderator: Apr 25, 2017
  2. MissMelissa

    MissMelissa New Member

    Messages:
    0
    Likes Received:
    0
    Joined:
    Dec 26, 2016
    Show your code that handles the "KillPanel" event.
     
  3. Draex

    Draex Active Member

    Messages:
    64
    Likes Received:
    31
    Joined:
    Apr 2, 2017
    Go trigger the close event on server side, right after you checked if the login data was correct
     
  4. Dane

    Dane Member

    Messages:
    17
    Likes Received:
    1
    Joined:
    Apr 20, 2017
    Last edited: Apr 26, 2017
  5. Draex

    Draex Active Member

    Messages:
    64
    Likes Received:
    31
    Joined:
    Apr 2, 2017
    You're not receiving the event cause your K is uppercase on the server and lower case on the client,
    If you change it, it should work
     
  6. Dane

    Dane Member

    Messages:
    17
    Likes Received:
    1
    Joined:
    Apr 20, 2017
    Omg i feel so dumb right now! Thank you so much.
     

Share This Page