Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. Can't give points to players

Can't give points to players

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
9 Posts 2 Posters 234 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Nakeroundefined Offline
    Nakeroundefined Offline
    Nakero
    wrote on last edited by
    #1

    this is a part from my code where I try to give 10000 points,

    menu_fast_reset()
    {

    for (;;)
    {
            
            self waittill("reset_fast");
            self.score+=10000;
            self notify("close_menu");
    

    }
    }

    When I trigger 'reset_fast' i get the 'close_menu' notify but not the points
    help plzzz

    JezuzLizardundefined 1 Reply Last reply
    1
    • JezuzLizardundefined Offline
      JezuzLizardundefined Offline
      JezuzLizard Plutonium Staff
      replied to Nakero on last edited by
      #2

      @Nakero77 What is the caller of the menu_fast_reset() function?

      Nakeroundefined 2 Replies Last reply
      1
      • Nakeroundefined Offline
        Nakeroundefined Offline
        Nakero
        replied to JezuzLizard on last edited by
        #3

        JezuzLizard Im new to GSC so correct me if im wrong but menu_fast_reset() is a thread that should be inicialized since i write

        menu thread menu_fast_reset();

        few lines above, right?

        Nakeroundefined 1 Reply Last reply
        1
        • Nakeroundefined Offline
          Nakeroundefined Offline
          Nakero
          replied to Nakero on last edited by Nakero
          #4
          This post is deleted!
          1 Reply Last reply
          0
          • Nakeroundefined Offline
            Nakeroundefined Offline
            Nakero
            replied to JezuzLizard on last edited by
            #5

            JezuzLizard since i get the ''close menu'' notify i dont think its a problem with the function, it might be related with the self.score tool

            JezuzLizardundefined 1 Reply Last reply
            0
            • JezuzLizardundefined Offline
              JezuzLizardundefined Offline
              JezuzLizard Plutonium Staff
              replied to Nakero on last edited by
              #6

              @Nakero77 Well if the menu is the caller than self is the menu. You are trying to do menu.score += 10000;. If you want to set a player's score you call the function on a player so self will be the player.

              Nakeroundefined 1 Reply Last reply
              0
              • Nakeroundefined Offline
                Nakeroundefined Offline
                Nakero
                replied to JezuzLizard on last edited by Nakero
                #7

                JezuzLizard didn't undertood tbh, what i need to change exacly?

                inicialize the thread as
                player thread menu_fast_reset();

                ????

                JezuzLizardundefined 1 Reply Last reply
                0
                • JezuzLizardundefined Offline
                  JezuzLizardundefined Offline
                  JezuzLizard Plutonium Staff
                  replied to Nakero on last edited by
                  #8

                  @Nakero77 I don't know what your codebase looks like so I don't know the exact answer. All I know is from the examples you've given me you are trying to set the score of a menu not a player. Either pass the player as self by making a player the caller, or pass a player as an argument and do player.score.

                  Nakeroundefined 1 Reply Last reply
                  0
                  • Nakeroundefined Offline
                    Nakeroundefined Offline
                    Nakero
                    replied to JezuzLizard on last edited by
                    #9

                    JezuzLizard i changed
                    self.score+=10000; into player.score+=10000;
                    but still getting nothing :(((

                    1 Reply Last reply
                    0

                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Donate