Skip to content
  • 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 393 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.
  • 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

      • Login

      • Don't have an account? Register

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