• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Switch To Next Weapon
#1
Brick 
Any one knows how to do such a thing?

I know theres switchToWeapon but it needs a weapon name, is there a way to just switch to next weapon?
  Reply
#2
C++ Code
  1. weaponList = self getWeaponListPrimaries();
  2. curWeapon = self getCurrentWeapon();
  3. for( i = 0; i < weaponList.size; i++ )
  4. {
  5. if( curWeapon == weaponList[i] )
  6. continue;
  7.  
  8. if( isDefined( weaponList[ i+1 ] ) )
  9. {
  10. self switchToWeapon( weaponList[ i+1 ] );
  11. break;
  12. }
  13. else
  14. {
  15. self switchToWeapon( weaponList[ i-1 ] );
  16. break;
  17. }
  18. }


?
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

  Reply
#3
(07-19-2011, 19:17)iAegle Wrote:
C++ Code
  1. weaponList = self getWeaponListPrimaries();
  2. curWeapon = self getCurrentWeapon();
  3. for( i = 0; i < weaponList.size; i++ )
  4. {
  5. if( curWeapon == weaponList[i] )
  6. continue;
  7.  
  8. if( isDefined( weaponList[ i+1 ] ) )
  9. {
  10. self switchToWeapon( weaponList[ i+1 ] );
  11. break;
  12. }
  13. else
  14. {
  15. self switchToWeapon( weaponList[ i-1 ] );
  16. break;
  17. }
  18. }


?

Looks exactly like what I need thx alot

can you just explain me how to add this as a self function? so I can do self weaponNext and it switch to the next weapon?

EDIT : I get unknown fucntion for

weaponList = self getWeaponListPrimaries();

EDIT: you forgot a s to weapon

EDIT: got it working nvm
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Shocked [Request] Switch plugin axel-le-meilleur 6 4,612 10-19-2013, 06:59
Last Post: iRoNinja
Question Help Mw2 weapon skin question FroxIVx4 1 2,757 10-13-2013, 16:54
Last Post: hmann
Question Help Weapon Name iRoNinja 8 6,009 10-08-2013, 08:31
Last Post: iRoNinja
  Mw2 weapon porting? Cuddlyedits 3 4,327 09-15-2013, 16:43
Last Post: DidUknowiPwn
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 30,326 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
Exclamation [Request] Random Weapon At Spawn Scripts18 3 4,369 07-27-2013, 23:53
Last Post: DidUknowiPwn
  Help Mw2 weapon skin question FroxIVx4 1 2,681 07-06-2013, 19:22
Last Post: surtek
  [Request] List of all weapon models DidUknowiPwn 3 4,316 04-20-2013, 09:13
Last Post: Dominator56
  [Release] !weapon Plugin 8q4s8 40 23,471 03-24-2013, 17:02
Last Post: X-Track
  [Release] Black Ops ZM & MP weapon ID's JariZ 7 29,085 03-01-2013, 22:04
Last Post: JariZ

Forum Jump:


Users browsing this thread: 1 Guest(s)