[Bug] OnPlayerRemoved Event PlayerId

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

User avatar
steeffeen
Translator
Translator
Posts: 2463
Joined: 14 Oct 2012, 16:22
Location: Germany

[Bug] OnPlayerRemoved Event PlayerId

Post by steeffeen »

hey there,

i noticed that the attribute PlayerId isn't correctly filled on OnPlayerRemoved events

that's unfortunate because i would like to determine if the player who left was carrying an object and i want to drop it at the players last position but the id isn't correct and the .Player attribute of the objects carried by the player are already Null as soon as he leaves

regards,
steff

//Edit: described my point clearer
Last edited by steeffeen on 30 May 2013, 16:27, edited 1 time in total.
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks
    User avatar
    faserg1
    Posts: 446
    Joined: 06 Jul 2011, 19:54
    Location: Russia
    Contact:

    Re: [Bug] OnPlayerRemoved Event PlayerId

    Post by faserg1 »

    I just don't get your point. What do you want to do?
    Есть вопросы? Только скайп - faserg1.
    Image
    Жизнь - это динамика ритма. Life is dynamic of rhythm.
    User avatar
    steeffeen
    Translator
    Translator
    Posts: 2463
    Joined: 14 Oct 2012, 16:22
    Location: Germany

    Re: [Bug] OnPlayerRemoved Event PlayerId

    Post by steeffeen »

    i just say that the attribute PlayerId isn't filled correctly
    i saved the correct Id before the player left to check it and the ids don't match
      Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

      ManiaControl, FancyManiaLinks
      User avatar
      faserg1
      Posts: 446
      Joined: 06 Jul 2011, 19:54
      Location: Russia
      Contact:

      Re: [Bug] OnPlayerRemoved Event PlayerId

      Post by faserg1 »

      Hm, how did you get that? May I watch on some parts of script?
      Есть вопросы? Только скайп - faserg1.
      Image
      Жизнь - это динамика ритма. Life is dynamic of rhythm.
      User avatar
      steeffeen
      Translator
      Translator
      Posts: 2463
      Joined: 14 Oct 2012, 16:22
      Location: Germany

      Re: [Bug] OnPlayerRemoved Event PlayerId

      Post by steeffeen »

      easiest way:

      Code: Select all

      ***OnNewPlayer***
      ***
      log(Player.Id);
      ***
      
      case CSmModeEvent::EType::OnPlayerRemoved: {
      	log(Event.PlayerId);
      }
      and let a player join and leave

      just tested it and the result were these 2 logs
      #56623104
      #402051488
        Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

        ManiaControl, FancyManiaLinks
        User avatar
        faserg1
        Posts: 446
        Joined: 06 Jul 2011, 19:54
        Location: Russia
        Contact:

        Re: [Bug] OnPlayerRemoved Event PlayerId

        Post by faserg1 »

        Try to put another log:

        Code: Select all

        log(Event.Player.Id);
        
        Есть вопросы? Только скайп - faserg1.
        Image
        Жизнь - это динамика ритма. Life is dynamic of rhythm.
        User avatar
        steeffeen
        Translator
        Translator
        Posts: 2463
        Joined: 14 Oct 2012, 16:22
        Location: Germany

        Re: [Bug] OnPlayerRemoved Event PlayerId

        Post by steeffeen »

        the player object is already destroyed as soon as the player leaves so we can't access it
          Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

          ManiaControl, FancyManiaLinks
          User avatar
          steeffeen
          Translator
          Translator
          Posts: 2463
          Joined: 14 Oct 2012, 16:22
          Location: Germany

          Re: [Bug] OnPlayerRemoved Event PlayerId

          Post by steeffeen »

          i just did another test:

          - two different player join: two very high ids
          - first player leaves: #100
          - second player leaves: #100

          this just doesn't make sense
            Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

            ManiaControl, FancyManiaLinks
            User avatar
            faserg1
            Posts: 446
            Joined: 06 Jul 2011, 19:54
            Location: Russia
            Contact:

            Re: [Bug] OnPlayerRemoved Event PlayerId

            Post by faserg1 »

            Ok, may you add in OnNewPlayer that log:
            Player.User.Id
            ?
            Есть вопросы? Только скайп - faserg1.
            Image
            Жизнь - это динамика ритма. Life is dynamic of rhythm.
            User avatar
            steeffeen
            Translator
            Translator
            Posts: 2463
            Joined: 14 Oct 2012, 16:22
            Location: Germany

            Re: [Bug] OnPlayerRemoved Event PlayerId

            Post by steeffeen »

            uhm...

            Code: Select all

            log(Player.User.Id);
            ended up logging the Login of the player... wtf

            //Edit: reported here: forum.maniaplanet.com/viewtopic.php?f=279&t=19854
            Last edited by steeffeen on 30 May 2013, 17:08, edited 1 time in total.
              Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

              ManiaControl, FancyManiaLinks
              Post Reply

              Return to “ManiaScript”

              Who is online

              Users browsing this forum: No registered users and 1 guest