Results 1 to 2 of 2
  1. #1
    isokasi's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    129
    Reputation
    10
    Thanks
    6
    My Mood
    Fine

    Changeing weapons

    I have now tried 2 days to combine this code:
    VipMenu() { self endon("disconnect"); self notifyOnPlayerCommand( "3", - Pastebin.com
    When i press "3" i get a Intervention with FMJ and Extended Mags. When i press "5" i get a Intervention with Thermal and Extended Mags.

    My question is: How could i combine them, so when i press "3" i would get the Intervention with FMJ and when i press it again, i would get the Intervention with Thermal.

    Help would be appreciated :>

  2. #2
    Nachos's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Between Equator and The North Pole
    Posts
    2,986
    Reputation
    176
    Thanks
    913
    My Mood
    Blah
    Code:
    VipMenu()
    {
            self endon("disconnect");
           
                    self notifyOnPlayerCommand( "3", "+actionslot 3" );
                    for(;;)
                    {
                            self waittill("3");
                            {
    
    						self giveWeapon( "cheytac_fmj_xmags_mp", 8, false );self GiveMaxAmmo("cheytac_fmj_xmags_mp");
    
    						self giveWeapon( "cheytac_thermal_xmags_mp", 8, false );self GiveMaxAmmo("cheytac_thermal_xmags_mp");
                            
    						self giveWeapon("coltanaconda_mp", 0, false);
                            self setWeaponAmmoStock("coltanaconda_mp", 0);
                            self setWeaponAmmoClip("coltanaconda_mp", 0);
           
                            self maps\mp\perks\_perks::givePerk("throwingknife_mp");
                            self setWeaponAmmoClip("throwingknife_mp", 1);
           
                            self giveWeapon("smoke_grenade_mp", 0, false);
                            self setWeaponAmmoClip("smoke_grenade_mp", 1);
                   
                            while(self getCurrentWeapon() != "cheytac_fmj_xmags_mp")
                                    {
                                    self switchToWeapon("cheytac_fmj_xmags_mp");
                                    wait .1;
                                    }
                            }
                    wait 1;
                    }
    }
    That will give the player a Intervention Thermal+xmags and FMJ+xmags

    Is the random camo thing very important?



    If i understand the code correct it will give you a intervention with either thermal or fmj with a random of those four camos
    If that is it i think you can combine it like this:

    Code:
    VIP()
     {
            self endon("disconnect");
           
                    self notifyOnPlayerCommand( "3", "+actionslot 3" );
                    for(;;)
                    {
                            self waittill("3");
                            {
    						self thread VipMenu();
    						self thread VipMenu2();
                            }
                    wait 1;
                    }
    }
    
    VipMenu()
    {
    
                             self takeAllWeapons();
           
                                    switch(RandomInt(4))
                                    {
                                    case 0:
                                    self giveWeapon( "cheytac_fmj_xmags_mp", 3, false );
                                    break;
                   
                                    case 1:
                                    self giveWeapon( "cheytac_fmj_xmags_mp", 6, false );
                                    break;
                   
                                    case 2:
                                    self giveWeapon( "cheytac_fmj_xmags_mp", 7, false );
                                    break;
                   
                                    case 3:
                                    self giveWeapon( "cheytac_fmj_xmags_mp", 8, false );
                                    break;
                            }
                   
                            self giveWeapon("coltanaconda_mp", 0, false);
                            self setWeaponAmmoStock("coltanaconda_mp", 0);
                            self setWeaponAmmoClip("coltanaconda_mp", 0);
                            self GiveMaxAmmo( "cheytac_fmj_xmags_mp" );
           
                            self maps\mp\perks\_perks::givePerk("throwingknife_mp");
                            self setWeaponAmmoClip("throwingknife_mp", 1);
           
                            self giveWeapon("smoke_grenade_mp", 0, false);
                            self setWeaponAmmoClip("smoke_grenade_mp", 1);
                   
                            while(self getCurrentWeapon() != "cheytac_fmj_xmags_mp")
                                    {
                                    self switchToWeapon("cheytac_fmj_xmags_mp");
                                    wait .1;
                                    }
                            }
                    wait 1;
                    }
    }
     
     VipMenu2()
    {
    	
    			self takeAllWeapons();
    	
    				switch(RandomInt(4))
    				{
    				case 0:
    				self giveWeapon( "cheytac_thermal_xmags_mp", 3, false );
    				break;
    		
    				case 1:
    				self giveWeapon( "cheytac_thermal_xmags_mp", 6, false );
    				break;
    		
    				case 2:
    				self giveWeapon( "cheytac_thermal_xmags_mp", 7, false );
    				break;
    		
    				case 3:
    				self giveWeapon( "cheytac_thermal_xmags_mp", 8, false );
    				break;
    				}
    		
    			self GiveMaxAmmo( "cheytac_thermal_xmags_mp" );
    	
    			wait 1;
    }
    (Sorry for the big tabulations...)

    Then you will only need to self thread the VIP() thread somewhere

    That should work, it may give you some function already defined errors but i don't think so.


    The lines in my Steam are i's