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 