[Zombies] Get Secondary/Next Weapon Name/ID
-
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?
-
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.
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