Results 1 to 5 of 5
  1. #1

    Best event to use when a player has actually entered the game

    Hello, what would be the best event to use to determine when a player has actually entered the game.


    onPlayerJoin() is not sufficient, it is triggered soon as they click "join" on battlelog which if they cancel does not trigger onPlayerLeave() also they can click join multiple times and it is triggered multiple times coding wise this is not good...lol

    I have also found: onAuthenticated() however, this again is triggered before they actually get ingame so i assume leaving at this stage would again not trigger the onPlayerLeave(), or does it?


    finally, i also found onPlayerLoading() or something and I think this is probably the best one giving that its the furthest point in the "join process" but im also pretty sure again u can alt F4 at this point and it wil not trigger onPLayerLeave().

    Any help appriciated.

  2. #2
    The one and only Bassyboy
    Join Date
    Jul 2010
    Location
    Netherlands
    Posts
    3,274
    When a player is "onAuthenticated" and leaves, you will see an "onLeave" event.

    But I guess if you want to be 100% sure a player joined the server, you can look for the first "onSpawn" event of that player.

  3. #3
    For AdKats I fire joins when the player has entered the list of players returned from the server. If they are not returned in that list, they are not in the server. This is made reliable since I query player list every 10 seconds, but can be slightly delayed if you leave the default 30 second query time for player listing.
    ____

  4. #4
    @Neo, okay, why do you want to know all these things? What plugin are you writing?

    (How much you want to bet it covers a subset of AdKats?)
    Don't send me private messages (PMs) unless you really need privacy, like your game server password. If you just have a question or need help, post in one of the threads. It's extra work for me to answer questions and give help in private messages and no one else gets the benefit of the answer.

  5. #5
    The one and only Bassyboy
    Join Date
    Jul 2010
    Location
    Netherlands
    Posts
    3,274
    Quote Originally Posted by PapaCharlie9 View Post
    @Neo, okay, why do you want to know all these things? What plugin are you writing?

    (How much you want to bet it covers a subset of AdKats?)
    On a side note: good to see you are still around

    Sent from my Galaxy S6 Edge using Tapatalk
    I won't do support via PM: if you need help, make a topic on the public forums.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •