Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Request Weapon list
#1
Just a simple code to make a weapon list (tell me where to put the weapon name please)

also is it possible to make 2 weapons list and link weapons together like I will show an example of what I mean

List:
1:ak47_mp
2:l96_mp
3Confusedpas12_mp

List2:
1:ballistic knife
2:makarov
3:python

ak47_mp is linked to ballistic knife
l96_mp is linked to makarov
etc...
Reply

#2
C++ Code
  1. weaponcode()
  2. {
  3. weaponlist1 = [];
  4. weaponlist1[0] = "ak47_mp";
  5. weaponlist1[1] = "l96a1_mp";
  6. weaponlist1[2] = "spas12_mp";
  7.  
  8. weaponlist2 = [];
  9. weaponlist2[0] = "ballistic_knife_mp";
  10. weaponlist2[1] = "makarov_mp";
  11. weaponlist2[2] = "python_mp";
  12.  
  13. i = 0
  14.  
  15. self giveweapon(weaponlist1[i]);
  16. self giveweapon(weaponlist2[i]);
  17. }


Not sure if thats what you mean, but will help you understand it anyway.

That code will give ak47+ballistic, l96+makarov, spas12+python, depending on what value of i you have. (If you wanted it random, just do i = randomintrange(0,2) or something like that).
Reply

#3
I will post the code Im using it for and you will tell me if its possible to do what I want

Code:
do_knife()
{        
    self endon( "death" );
    self endon ("disconnect");    
    
    clip_ammo = self GetWeaponAmmoClip( self.name );
    clip_max_ammo = WeaponClipSize( self.name );
    
    while(1)
        {                
        
        if(self FragButtonPressed() && self getcurrentweapon("Normalknife_sp"))
                       {
                           self waittill(!self getcurrentweapon("ThrowingNormalKnife_Sp"));
                           self takeweapon("Normalknife_sp");                          
                           self giveWeapon("rebirth_hands_sp");
                              wait 0.05;
                              if(self hasweapon("rebirth_hands_sp"))
                                   {
                                      self switchtoweapon("rebirth_hands_sp");
                                   }    
                              else
                                   {
                                      self thread do_next();
                                   }
                       }
        if(self hasweapon("rebirth_hands_sp"))    
                       {
                           wait 0.1;
                           self takeweapon("NormalKnife_sp");
                       }  
        if(self GetAmmoCount("ThrowingNormalKnife_sp") >= 1)
                       {
                           self giveweapon("NormalKnife_sp");
                           self takeweapon("rebirth_hands_sp");
                       }
                if(self usebuttonpressed())
                       {
                           self switchtoweapon("NormalKnife_sp");
                       }                          
        if(self GetAmmoCount("ThrowingNormalKnife_sp") == 0)
                       {
                           self takeweapon("NormalKnife_sp");
                       }                                 
            wait 0.01;    
        }
}

(I dont recommend any one to use this code it has issues yet and Its for my own use, ask me before using it or any part of it :S)I wanna link the NormalKnife_sp (in this case) with the ThrowingNormalKnife_sp
but I have also like 7 other same thread like this with other weapons (including their throwing variants) I wanna link them so it doesnt mess up the whole code and to have less threads and so I can take many knives without bugging it all
Reply

#4
Still not quite understand you.. but I think you mean. Whenever you want to take away weapon X, you want to give them weapon Y? Or when take away weapon X, you also want to take away weapon Y?

In which case the code I gave should work. Just put weaponlist1[0] anmd weaponlist2[0] to be the weapons you want `linked`. Add me on steam/xfire madnesslink5 if you need more help.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Question Help Mw2 weapon skin question FroxIVx4 1 2,950 10-13-2013, 16:54
Last Post: hmann
Question Help Weapon Name iRoNinja 8 6,584 10-08-2013, 08:31
Last Post: iRoNinja
  Mw2 weapon porting? Cuddlyedits 3 4,734 09-15-2013, 16:43
Last Post: DidUknowiPwn
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 33,270 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
Exclamation [Request] Random Weapon At Spawn Scripts18 3 4,737 07-27-2013, 23:53
Last Post: DidUknowiPwn
  Help Server not in list, but people join 99IRock 8 7,103 07-17-2013, 21:26
Last Post: clacki
  Help Mw2 weapon skin question FroxIVx4 1 2,921 07-06-2013, 19:22
Last Post: surtek
  List of models that can be spawned? (Looking for C4 model) akillj 5 4,799 06-27-2013, 13:35
Last Post: Yamato
  [Request] mw3 all map list ( aslo DLC) raminr63 5 14,968 06-18-2013, 19:50
Last Post: mn_acer1
Big Grin Killstreaks HUD list Puffiamo 9 9,931 06-18-2013, 18:42
Last Post: RaZ

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.