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.

Trigger return

Discussion in 'Archive' started by Yumakaev, Feb 8, 2017.

Thread Status:
Not open for further replies.
  1. Yumakaev

    Yumakaev Active Member

    Messages:
    71
    Likes Received:
    2
    Joined:
    Jan 22, 2017
    Why the trigger works once? At the following calling the user doesn't see a form
     
  2. introzen

    introzen Member

    Messages:
    30
    Likes Received:
    7
    Joined:
    Jan 25, 2017
    What do you mean? Please explicate.
     
  3. Yumakaev

    Yumakaev Active Member

    Messages:
    71
    Likes Received:
    2
    Joined:
    Jan 22, 2017
    Once is caused to cause once again, restart of the server is required
    PHP:
    API.onServerEventTrigger.connect(function (eventNamenum1) { 
        switch(
    eventName)
        {
            case 
    'isAcc':
            var 
    res API.getScreenResolution();
            
    myBrowser API.createCefBrowser(res.Widthres.Height);
            
    API.waitUntilCefBrowserInit(myBrowser);
            
    API.setCefBrowserPosition(myBrowser00);
            
    API.loadPageCefBrowser(myBrowser"web/reg_form.html");
            
    API.showCursor(true);
            
    API.setCanOpenChat(false);
            break;
        }
    });
    API.onServerEventTrigger.connect(function (eventNamenum2) { 
            switch(
    eventName)
            {
                case 
    'isAcc_':
                var 
    res API.getScreenResolution();
                
    myBrowser API.createCefBrowser(res.Widthres.Height);
                
    API.waitUntilCefBrowserInit(myBrowser);
                
    API.setCefBrowserPosition(myBrowser00);
                
    API.loadPageCefBrowser(myBrowser"web/log_form.html");
                
    API.showCursor(true);
                
    API.setCanOpenChat(false);
                break;
            }
    });
     
  4. introzen

    introzen Member

    Messages:
    30
    Likes Received:
    7
    Joined:
    Jan 25, 2017
    EDIT:

    Code:
    API.onServerEventTrigger.connect(function (eventName, num1) { 
        switch(eventName)
        {
            case 'isAcc':
                var res = API.getScreenResolution();
                myBrowser = API.createCefBrowser(res.Width, res.Height);
                API.waitUntilCefBrowserInit(myBrowser);
                API.setCefBrowserPosition(myBrowser, 0, 0);
                API.loadPageCefBrowser(myBrowser, "web/reg_form.html");
                API.showCursor(true);
                API.setCanOpenChat(false);
                break;
               
            case 'isAcc_':
                var res = API.getScreenResolution();
                myBrowser = API.createCefBrowser(res.Width, res.Height);
                API.waitUntilCefBrowserInit(myBrowser);
                API.setCefBrowserPosition(myBrowser, 0, 0);
                API.loadPageCefBrowser(myBrowser, "web/log_form.html");
                API.showCursor(true);
                API.setCanOpenChat(false);
                break;
        }
    });
    
     
  5. root

    root Well-Known Member

    Messages:
    244
    Likes Received:
    88
    Joined:
    Aug 15, 2016
    You should only have
    Code:
    API.onServerEventTrigger.connect(function (eventName, args)
    once in your code and trigger all other events from there.
     
  6. Yumakaev

    Yumakaev Active Member

    Messages:
    71
    Likes Received:
    2
    Joined:
    Jan 22, 2017
    PHP:
    public void TriggSrat(Client player)
            {
                
    UserAccount accounts_ _userRepository.GetAccount(player.name);
                if (
    accounts_ == null)
                {
                    
    num1 2;
                    
    API.triggerClientEvent(player"isAcc"num1);
                    
    API.sendChatMessageToPlayer(player"Text " num1);
                }
                if (
    accounts_.Username != null)
                {
                    
    num2 1;
                    
    API.triggerClientEvent(player"isAcc_"num2);
                    
    API.sendChatMessageToPlayer(player"Text " num2);
                }
            }
     
  7. Yumakaev

    Yumakaev Active Member

    Messages:
    71
    Likes Received:
    2
    Joined:
    Jan 22, 2017
    Doesn't work
     
  8. root

    root Well-Known Member

    Messages:
    244
    Likes Received:
    88
    Joined:
    Aug 15, 2016
    Show your Client side JS file??
     
  9. Yumakaev

    Yumakaev Active Member

    Messages:
    71
    Likes Received:
    2
    Joined:
    Jan 22, 2017
    PHP:
    API.onResourceStart.connect(function()
    {
    });
    API.onServerEventTrigger.connect(function (eventNameargs) {
        switch(
    eventName)
        {
            case 
    'isAcc':
                var 
    res API.getScreenResolution();
                
    myBrowser API.createCefBrowser(res.Widthres.Height);
                
    API.waitUntilCefBrowserInit(myBrowser);
                
    API.setCefBrowserPosition(myBrowser00);
                
    API.loadPageCefBrowser(myBrowser"web/reg_form.html");
                
    API.showCursor(true);
                
    API.setCanOpenChat(false);
                break;
            
            case 
    'isAcc_':
                var 
    res API.getScreenResolution();
                
    myBrowser API.createCefBrowser(res.Widthres.Height);
                
    API.waitUntilCefBrowserInit(myBrowser);
                
    API.setCefBrowserPosition(myBrowser00);
                
    API.loadPageCefBrowser(myBrowser"web/log_form.html");
                
    API.showCursor(true);
                
    API.setCanOpenChat(false);
                break;
        }
    });
     
  10. introzen

    introzen Member

    Messages:
    30
    Likes Received:
    7
    Joined:
    Jan 25, 2017
    What happens? What does not happen?
     
  11. Yumakaev

    Yumakaev Active Member

    Messages:
    71
    Likes Received:
    2
    Joined:
    Jan 22, 2017
    Once is caused, after shutdown of the player - isn't caused
     
  12. introzen

    introzen Member

    Messages:
    30
    Likes Received:
    7
    Joined:
    Jan 25, 2017
  13. Yumakaev

    Yumakaev Active Member

    Messages:
    71
    Likes Received:
    2
    Joined:
    Jan 22, 2017
  14. introzen

    introzen Member

    Messages:
    30
    Likes Received:
    7
    Joined:
    Jan 25, 2017
    Yes, please.
     
  15. Yumakaev

    Yumakaev Active Member

    Messages:
    71
    Likes Received:
    2
    Joined:
    Jan 22, 2017
    For what html?
     
  16. Yumakaev

    Yumakaev Active Member

    Messages:
    71
    Likes Received:
    2
    Joined:
    Jan 22, 2017
    HTML:
    <script>
        function logPlayer() 
        {
            var password = $("#password").val();
            resourceCall("LogUser", password); //Отправка
            resourceCall("login", password);
        }
    </script>
     
  17. introzen

    introzen Member

    Messages:
    30
    Likes Received:
    7
    Joined:
    Jan 25, 2017
    Is the user logged in correctly? Are you destroying the CEF correctly upon successful login?
     
  18. Yumakaev

    Yumakaev Active Member

    Messages:
    71
    Likes Received:
    2
    Joined:
    Jan 22, 2017
    Yes
     
  19. andreasb

    andreasb Well-Known Member

    Messages:
    128
    Likes Received:
    61
    Joined:
    Aug 4, 2016
    You're still doing two resourceCall()'s, and I'm not sure why.
     
Thread Status:
Not open for further replies.

Share This Page