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

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. [Zombies] Get Secondary/Next Weapon Name/ID

[Zombies] Get Secondary/Next Weapon Name/ID

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
zombiesservergsc
2 Posts 1 Posters 853 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.
  • A Former User? Offline
    A Former User? Offline
    A Former User
    wrote on last edited by A Former User
    #1

    I tried everything to get a GSC script to get the name/ID of the secondary/next weapon in zombies and was unsuccessful. I just got the name of the current weapon and hand off. Does anyone here know how to do this?

    1 Reply Last reply
    0
    • A Former User? Offline
      A Former User? Offline
      A Former User
      wrote on last edited by
      #2

      I was able to find the function that does this!

      If someone is interested in using it, follow the code I made:

      changeRound()
      {
          for(;;)
          {
              level waittill( "end_of_round" ); // "start_of_round" works too
              wait 0.1;
              allWeapons = primaryWeapons();
      		
              if( level.round_number > 0 && isDefined(allWeapons) )
              {
                  i = 0;
                  while ( i < allWeapons.size )
                  {
                      self setweaponammoclip( allWeapons[i], weaponclipsize( allWeapons[i] ) );
                      self givemaxammo( allWeapons[i] );
                      i++;
                  }
                  iprintln( "Voce mereceu, toma aqui seu ^2Max Ammo ^1<3" );
              }
          }
      }
      
      primaryWeapons()
      {
          primaryWeapons = self getweaponslistprimaries();
          if( primaryWeapons.size > 0 )
          {
              return primaryWeapons;
          }
          else
          {
              return;
          }
      }
      

      Basically, in this code created, at the end of the round the player get max ammo. It can be used when starting the round too, just change the "end_of_round" for "start_of_round".

      The function responsible for getting the names of the weapons is

      self getweaponslistprimaries ();
      

      returning an array with the names of weapons.

      1 Reply Last reply
      1

      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