Thread: Toggle Weapon?

Results 1 to 1 of 1
  1. #1
    ijwgamer's Avatar
    Join Date
    Sep 2013
    Gender
    male
    Location
    Long Island, New York
    Posts
    12
    Reputation
    10
    Thanks
    0
    My Mood
    Confused

    Toggle Weapon?

    I'm using Banz's "clean sniper mod" file to control classes.
    It's nice because it supports the ability to toggle marathon or SoH,
    and whichever the player chooses, they keep even if they die.
    (I did it myself before this, but the player would have to toggle marathon every time they spawned again).

    But I also want to add the ability to toggle between two weapons and am a little bit "under qualified" to even attempt this.
    (I could but I know I will fail).

    I want the player, to also be able to toggle between the Intervention (spawns with it anyway) and the m40a3.

    Repz Client implemented this m40a3 somehow. To play with the weapon normally..
    You just make an Intervention with no attachments or camo.
    I'm not sure if there is a weapon code for the m40a3 or not.


    Note: The mod I'm working on doesn't allow the ability to select a class.

    The Code: (entire gsc)

    Code:
    /*
    **      clean sniper mod
    **  with perk toggle
    **      by banz
    */
    #include maps\mp\_utility;
     
    init()
    {
     
            level.customClassCB = ::handleCustomClass;
           
            //disable killstreaks
            level.killstreakRewards = false;
           
            //delete turrets
            level deletePlacedEntity("misc_turret");
           
            level thread onPlayerConnect();
    }
     
    onPlayerConnect()
    {
            level endon( "game_ended" );
            for(;;)
            {
                    level waittill( "connected", player );
                   
                    if ( !isDefined( player.pers["perk1"] ) )
                            player.pers["perk1"] = 0;
                           
                    if( !isDefined( player.pers["message_shown"] ) )
                            player.pers["message_shown"] = 0;
                   
                   
                    player thread onPlayerSpawned();
                   
                    player thread watchToggle();
            }
    }
     
    onPlayerSpawned()
    {
            self endon( "disconnect" );
           
            for(;;)
            {
                    self waittill( "spawned_player" );
            }
    }
     
     
    //inform player about how to switch between the perks  
    infoMessage()
    {
       self endon("disconnect");
       self endon("death");
       self.pers["message_shown"]++;  
       wait 0.5;
       
       for( i=0; i<3; i++) {
          self iPrintlnBold( "^7Press ^3[{+actionslot 4}] ^7to change your ^31st perk" );
          wait 2;
       }
       
    }
     
     
    handleCustomClass()
    {
            class = [];
            class["loadoutPrimary"] = "cheytac";
            class["loadoutPrimaryAttachment"] = "fmj";
            class["loadoutPrimaryAttachment2"] = "xmags";
            class["loadoutPrimaryCamo"] = "none";
            class["loadoutSecondary"] = "deserteaglegold";
            class["loadoutSecondaryAttachment"] = "none";
            class["loadoutSecondaryAttachment2"] = "none";
            class["loadoutSecondaryCamo"] = "none";
            class["loadoutEquipment"] = "none";
            class["loadoutPerk1"] = "none";
            class["loadoutPerk2"] = "none";
            class["loadoutPerk3"] = "none";
            class["loadoutOffhand"] = "none";
        class["loadoutDeathstreak"] = "none";
           
            self maps\mp\gametypes\_class::giveLoadout( self.team, class, false );
    }
     
    loadoutSniperPerks()
    {
            self _clearPerks();
           
           
            /*
            **
            ** default perks
            */
            //sleight of hand base perk
            self _setPerk("specialty_fastreload");
            //steady aim pro perk
            self _setPerk("specialty_holdbreath");
            //lightweight pro perk
            self _setPerk("specialty_fastsprintrecovery");
            //stopping power base perk
            self _setPerk("specialty_bulletdamage");
            //commando pro perk
            self _setPerk("specialty_falldamage");
            //marathon pro perk
            self _setPerk("specialty_fastmantle");
           
           
           
            /*
            ** Perks to chose between
            **
            */
            if( self.pers["perk1"] ) {
                    self _setPerk("specialty_marathon");
                    self _setPerk("specialty_fastmantle");
            }      
            else {
                    self _setPerk("specialty_quickdraw");
            }
    }
     
    watchToggle()
    {
       self endon("disconnect");
       
       self notifyOnPlayerCommand("dat_perk", "+actionslot 4");
       
       for(;;) {
          self waittill( "dat_perk" );
         
          self.pers["perk1"] = !self.pers["perk1"];
             
              if( isAlive( self ) )
                            self loadoutSniperPerks();
             
          if( self.pers["perk1"] )
             self iPrintlnBold("^1Marathon");
          else
             self iPrintlnBold("^1Sleight of Hand");
       }
       
    }
    If anyone could help me out, I would greatly appreciate it. Feel free to contact me via Skype: thatKid.bro

    I know this isn't going to be the easiest of things to do, if someone is willing to really put an effort in to help me out with this, I would be more than happy to pay if requested or necessary.


    ~I swear I just posted this in the help section. Please move this again. I apologize to all of the moderators/admins in advance, I know I'm a moron
    Last edited by ijwgamer; 06-21-2014 at 03:11 AM.

Similar Threads

  1. warrock weapon skin hack
    By slash83 in forum WarRock - International Hacks
    Replies: 45
    Last Post: 02-10-2006, 05:43 PM
  2. list of weapon packets changed...
    By LuKan in forum WarRock - International Hacks
    Replies: 10
    Last Post: 02-09-2006, 06:19 AM
  3. [Searching] Weapons Hack
    By OutZida in forum WarRock - International Hacks
    Replies: 4
    Last Post: 01-19-2006, 01:06 PM
  4. [SEARCH]weapons
    By neoRUS in forum WarRock - International Hacks
    Replies: 4
    Last Post: 01-14-2006, 03:03 PM
  5. Two more weapons in Warrock
    By Zededarian in forum Game Hacking Tutorials
    Replies: 4
    Last Post: 01-04-2006, 02:54 PM