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

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. [Support] Save and load disabled

[Support] Save and load disabled

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
9 Posts 5 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • lula Offline
    lula Offline
    lula
    Contributor
    wrote on last edited by Mr. Android
    #1

    i just added save and load on my server and its all good untill you join the server and it says save and load disabled. anybody know how to fix

    chorchi175 1 Reply Last reply
    0
    • Ox_ Offline
      Ox_ Offline
      Ox_
      wrote on last edited by
      #2

      Maybe show code?
      Not quite sure what sort of answers you expect with the current state of your question.

      1 Reply Last reply
      0
      • lula Offline
        lula Offline
        lula
        Contributor
        wrote on last edited by
        #3

        Ox_ saveandload()

        {

        if (self.snl == 0)
        
        {
        
            self iprintln("^5Save and Load Enabled");
        
            self iprintln("Crouch and Press [{+actionslot 2}] To Save");
        
            self iprintln("Crouch and Press [{+actionslot 1}] To Load");
        
            self thread dosaveandload();
        
            self.snl = 1;
        
        }
        
        else
        
        {
        
            self iprintln("^1Save and Load Disabled");
        
            self.snl = 0;
        
            self notify("SaveandLoad");
        
        }
        

        }
        dosaveandload()

        {

        self endon("disconnect");
        
        self endon("SaveandLoad");
        
        load = 0;
        
        for(;;)
        
        {
        
        if (self actionslottwobuttonpressed() && self GetStance() == "crouch" && self.snl == 1)
        
        {
        
            self.o = self.origin;
        
            self.a = self.angles;
        
            load = 1;
        
            self iprintln("^5Position Saved");
        
            wait 2;
        
        }
        
        if (self actionslotonebuttonpressed() && self GetStance() == "crouch" && load == 1 && self.snl == 1)
        
        {
        
            self setplayerangles(self.a);
        
            self setorigin(self.o);
        
        }
        
        wait 0.05;
        

        }

        }

        And self thread saveandload(); in onPlayerSpawned() {

        Ox_ 1 Reply Last reply
        0
        • lula lula

          Ox_ saveandload()

          {

          if (self.snl == 0)
          
          {
          
              self iprintln("^5Save and Load Enabled");
          
              self iprintln("Crouch and Press [{+actionslot 2}] To Save");
          
              self iprintln("Crouch and Press [{+actionslot 1}] To Load");
          
              self thread dosaveandload();
          
              self.snl = 1;
          
          }
          
          else
          
          {
          
              self iprintln("^1Save and Load Disabled");
          
              self.snl = 0;
          
              self notify("SaveandLoad");
          
          }
          

          }
          dosaveandload()

          {

          self endon("disconnect");
          
          self endon("SaveandLoad");
          
          load = 0;
          
          for(;;)
          
          {
          
          if (self actionslottwobuttonpressed() && self GetStance() == "crouch" && self.snl == 1)
          
          {
          
              self.o = self.origin;
          
              self.a = self.angles;
          
              load = 1;
          
              self iprintln("^5Position Saved");
          
              wait 2;
          
          }
          
          if (self actionslotonebuttonpressed() && self GetStance() == "crouch" && load == 1 && self.snl == 1)
          
          {
          
              self setplayerangles(self.a);
          
              self setorigin(self.o);
          
          }
          
          wait 0.05;
          

          }

          }

          And self thread saveandload(); in onPlayerSpawned() {

          Ox_ Offline
          Ox_ Offline
          Ox_
          wrote on last edited by
          #4

          lula said in Save and load disabled:

          Ox_ saveandload()

          {

          if (self.snl == 0)
          
          {
          
              self iprintln("^5Save and Load Enabled");
          
              self iprintln("Crouch and Press [{+actionslot 2}] To Save");
          
              self iprintln("Crouch and Press [{+actionslot 1}] To Load");
          
              self thread dosaveandload();
          
              self.snl = 1;
          
          }
          
          else
          
          {
          
              self iprintln("^1Save and Load Disabled");
          
              self.snl = 0;
          
              self notify("SaveandLoad");
          
          }
          

          }
          dosaveandload()

          {

          self endon("disconnect");
          
          self endon("SaveandLoad");
          
          load = 0;
          
          for(;;)
          
          {
          
          if (self actionslottwobuttonpressed() && self GetStance() == "crouch" && self.snl == 1)
          
          {
          
              self.o = self.origin;
          
              self.a = self.angles;
          
              load = 1;
          
              self iprintln("^5Position Saved");
          
              wait 2;
          
          }
          
          if (self actionslotonebuttonpressed() && self GetStance() == "crouch" && load == 1 && self.snl == 1)
          
          {
          
              self setplayerangles(self.a);
          
              self setorigin(self.o);
          
          }
          
          wait 0.05;
          

          }

          }

          And self thread saveandload(); in onPlayerSpawned() {

          I'd assume you probably never define self.snl? You should define it before using it.
          Also toggling it on/off every time the player spawns in doesn't sound very good to me.

          1 Reply Last reply
          0
          • lula Offline
            lula Offline
            lula
            Contributor
            wrote on last edited by
            #5

            Ox_ what do i do to define it

            Sass 1 Reply Last reply
            0
            • lula lula

              Ox_ what do i do to define it

              Sass Offline
              Sass Offline
              Sass
              Plutonium Staff
              wrote on last edited by Sass
              #6

              lula Just as a reminder, the scripts you can find in the forum are mostly samples that are here to help people having a working script, so you can build your own mod around that. Copy pasting stuff and praying for the best doesn't always work.

              Not to mention that the script itself is pretty shitty tbh, since that saveandload() function does nothing but swap the values of self.snl between 1 and 0, so you should DEFINETLY NOT call that in your onPlayerSpawned() if you want this to work correctly.


              What I would do is completely get rid of the saveandload() function, and instead call dosaveandload() in your onPlayerSpawned(). Maybe save the "Crouch and Press" iprintlns to paste them at the start of dosaveandload(), between self endon("SaveandLoad"); and load = 0;, so you still have the explaination text popping up.

              Then in your OnPlayerConnect(), put player.snl = 1; between the closest brackets, and every user who connects will be able to use the Save & Load thing. If you have some kind of VIP check or anything, you can use it in your OnPlayerConnect() function to either grant the SnL or not, like this for example :

              // This doesn't actually work unless the isVip function exists, this is only an example...
              if(player isVip())
                  player.snl = 1;
              else
                  player.snl = 0;
              
              1 Reply Last reply
              0
              • lula Offline
                lula Offline
                lula
                Contributor
                wrote on last edited by
                #7

                Thanks Thats nice to know

                1 Reply Last reply
                0
                • Ducxy Offline
                  Ducxy Offline
                  Ducxy
                  wrote on last edited by
                  #8

                  For me I just completely removed the toggle. So delete the part that makes it disabled and anything else to do with disabling it.

                  1 Reply Last reply
                  0
                  • lula lula

                    i just added save and load on my server and its all good untill you join the server and it says save and load disabled. anybody know how to fix

                    chorchi175 Offline
                    chorchi175 Offline
                    chorchi175
                    wrote on last edited by
                    #9
                    This post is deleted!
                    1 Reply Last reply
                    0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

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