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

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. Convert int to String

Convert int to String

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
6 Posts 3 Posters 384 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.
  • Major_Tomundefined Offline
    Major_Tomundefined Offline
    Major_Tom
    wrote on last edited by
    #1

    How can i convert int to string?
    thanks

    1 Reply Last reply
    0
    • Resxtundefined Offline
      Resxtundefined Offline
      Resxt
      Plutonium Staff
      wrote on last edited by
      #2

      Did you try "" + int_variable?

      1 Reply Last reply
      0
      • Major_Tomundefined Offline
        Major_Tomundefined Offline
        Major_Tom
        wrote on last edited by
        #3

        Thanks it works

        How can i read kills from a file?

        Resxtundefined 1 Reply Last reply
        0
        • Major_Tomundefined Major_Tom

          Thanks it works

          How can i read kills from a file?

          Resxtundefined Offline
          Resxtundefined Offline
          Resxt
          Plutonium Staff
          wrote on last edited by
          #4

          Major_Tom maybe with something like this but I cannot help you with this I'm not familiar with working with files on Plutonium
          https://github.com/fedddddd/t6-gsc-utils#io

          1 Reply Last reply
          0
          • Major_Tomundefined Offline
            Major_Tomundefined Offline
            Major_Tom
            wrote on last edited by
            #5

            Possible example?
            write works but load not working

            load()
            {
            guid = self getGuid();
            basePath = getDvar("fs_basegame") + "/test/" + guid + ".txt";

            if(fileexists(basePath))
            {
                file = fopen(basePath, "r");
                fread(file, "" + self.pers["kills"] );
                fclose(file);
            }
            

            }

            JezuzLizardundefined 1 Reply Last reply
            0
            • Major_Tomundefined Major_Tom

              Possible example?
              write works but load not working

              load()
              {
              guid = self getGuid();
              basePath = getDvar("fs_basegame") + "/test/" + guid + ".txt";

              if(fileexists(basePath))
              {
                  file = fopen(basePath, "r");
                  fread(file, "" + self.pers["kills"] );
                  fclose(file);
              }
              

              }

              JezuzLizardundefined Offline
              JezuzLizardundefined Offline
              JezuzLizard
              Plutonium Staff
              wrote on last edited by
              #6

              Major_Tom fread returns a string of the contents of the file. You aren't storing the string or printing it anywhere.

              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