<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Grabbing A Weapon&#x27;s Camo...]]></title><description><![CDATA[<p dir="auto">The title says it all. Any ideas? I tried looking in _weapons.gsc and _class.gsc and didn't get too far.</p>
<p dir="auto">I want to be able to build a function or use a built in function to return a camo value (like 17 for diamond).</p>
<p dir="auto">I.E:</p>
<pre><code>CamoGrab()
{ return self GiveWeapon(weapon, 0, self calcweaponoptions( CAMO_INDEX, lens_index, reticle_index, reticle_color_index )); }
</code></pre>
<p dir="auto">Something like this, except only the camo. This function here was grabbed from the Bo2 zombie's gsc <code>maps\mp\zombies\_zm_weapons</code></p>
<pre><code>get_pack_a_punch_weapon_options( weapon )
{
    if ( !isDefined( self.pack_a_punch_weapon_options ) )
    {
        self.pack_a_punch_weapon_options = [];
    }
    if ( !is_weapon_upgraded( weapon ) )
    {
        return self calcweaponoptions( 0, 0, 0, 0, 0 );
    }
    if ( isDefined( self.pack_a_punch_weapon_options[ weapon ] ) )
    {
        return self.pack_a_punch_weapon_options[ weapon ];
    }
    smiley_face_reticle_index = 1;
    base = get_base_name( weapon );
    camo_index = 39;
    lens_index = randomintrange( 0, 6 );
    reticle_index = randomintrange( 0, 16 );
    reticle_color_index = randomintrange( 0, 6 );
    plain_reticle_index = 16;
    r = randomint( 10 );
    use_plain = r &lt; 3;
    if ( base == "saritch_upgraded_zm" )
    {
        reticle_index = smiley_face_reticle_index;
    }
    else
    {
        if ( use_plain )
        {
            reticle_index = plain_reticle_index;
        }
    }
/#
    if ( getDvarInt( #"471F9AB9" ) &gt;= 0 )
    {
        reticle_index = getDvarInt( #"471F9AB9" );
#/
    }
    scary_eyes_reticle_index = 8;
    purple_reticle_color_index = 3;
    if ( reticle_index == scary_eyes_reticle_index )
    {
        reticle_color_index = purple_reticle_color_index;
    }
    letter_a_reticle_index = 2;
    pink_reticle_color_index = 6;
    if ( reticle_index == letter_a_reticle_index )
    {
        reticle_color_index = pink_reticle_color_index;
    }
    letter_e_reticle_index = 7;
    green_reticle_color_index = 1;
    if ( reticle_index == letter_e_reticle_index )
    {
        reticle_color_index = green_reticle_color_index;
    }
    self.pack_a_punch_weapon_options[ weapon ] = self calcweaponoptions( camo_index, lens_index, reticle_index, reticle_color_index );
    return self.pack_a_punch_weapon_options[ weapon ];
}
</code></pre>
<p dir="auto">Not too much beyond this seems to yield any results unfortunately. Looking in _class.gsc, this is the closest i can find to anything camo related here.</p>
<pre><code>giveloadout( team, class ) //checked partially changed to match cerberus output did not use continue in for loop see github for more info
{
	pixbeginevent( "giveLoadout" );
	self takeallweapons();
	primaryindex = 0;
	self.specialty = [];
	self.killstreak = [];
	primaryweapon = undefined;
	self notify( "give_map" );
	class_num_for_killstreaks = 0;
	primaryweaponoptions = 0;
	secondaryweaponoptions = 0;
	playerrenderoptions = 0;
	primarygrenadecount = 0;
	iscustomclass = 0;
	if ( issubstr( class, "CLASS_CUSTOM" ) )
	{
		pixbeginevent( "custom class" );
		class_num = int( class[ class.size - 1 ] ) - 1;
		if ( class_num == -1 )
		{
			class_num = 9;
		}
		self.class_num = class_num;
		self reset_specialty_slots( class_num );
		playerrenderoptions = self calcplayeroptions( class_num );
		class_num_for_killstreaks = class_num;
		iscustomclass = 1;
		pixendevent();
	}
	else
	{
		pixbeginevent( "default class" );
		/*
/#
		assert( isDefined( self.pers[ "class" ] ), "Player during spawn and loadout got no class!" );
#/
		*/
		class_num = level.classtoclassnum[ class ];
		self.class_num = class_num;
		pixendevent();
	}
	knifeweaponoptions = self calcweaponoptions( class_num, 2 );
	self giveweapon( "knife_mp", 0, knifeweaponoptions );
	self.specialty = self getloadoutperks( class_num );
	if ( level.leaguematch )
	{
		for ( i = 0; i &lt; self.specialty.size; i++ )
		{
			if ( isleagueitemrestricted( self.specialty[ i ] ) )
			{
				arrayremoveindex( self.specialty, i );
				i--;

			}
		}
	}
	self register_perks();
	self setactionslot( 3, "altMode" );
	self setactionslot( 4, "" );
	givekillstreaks( class_num_for_killstreaks );
	spawnweapon = "";
	initialweaponcount = 0;
	if ( isDefined( self.pers[ "weapon" ] ) &amp;&amp; self.pers[ "weapon" ] != "none" &amp;&amp; !maps/mp/killstreaks/_killstreaks::iskillstreakweapon( self.pers[ "weapon" ] ) )
	{
		weapon = self.pers[ "weapon" ];
	}
	else
	{
		weapon = self getloadoutweapon( class_num, "primary" );
		weapon = removeduplicateattachments( weapon );
		if ( maps/mp/killstreaks/_killstreaks::iskillstreakweapon( weapon ) )
		{
			weapon = "weapon_null_mp";
		}
	}
	sidearm = self getloadoutweapon( class_num, "secondary" );
	sidearm = removeduplicateattachments( sidearm );
	if ( maps/mp/killstreaks/_killstreaks::iskillstreakweapon( sidearm ) )
	{
		sidearm = "weapon_null_mp";
	}
	self.primaryweaponkill = 0;
	self.secondaryweaponkill = 0;
	if ( self isbonuscardactive( 2, self.class_num ) )
	{
		self.primaryloadoutweapon = weapon;
		self.primaryloadoutaltweapon = weaponaltweaponname( weapon );
		self.secondaryloadoutweapon = sidearm;
		self.secondaryloadoutaltweapon = weaponaltweaponname( sidearm );
	}
	else if ( self isbonuscardactive( 0, self.class_num ) )
	{
		self.primaryloadoutweapon = weapon;
	}
	if ( self isbonuscardactive( 1, self.class_num ) )
	{
		self.secondaryloadoutweapon = sidearm;
	}
	if ( sidearm != "weapon_null_mp" )
	{
		secondaryweaponoptions = self calcweaponoptions( class_num, 1 );
	}
	primaryweapon = weapon;
	if ( primaryweapon != "weapon_null_mp" )
	{
		primaryweaponoptions = self calcweaponoptions( class_num, 0 );
	}
	if ( sidearm != "" &amp;&amp; sidearm != "weapon_null_mp" &amp;&amp; sidearm != "weapon_null" )
	{
		self giveweapon( sidearm, 0, secondaryweaponoptions );
		if ( self hasperk( "specialty_extraammo" ) )
		{
			self givemaxammo( sidearm );
		}
		spawnweapon = sidearm;
		initialweaponcount++;
	}
	primaryweapon = weapon;
	primarytokens = strtok( primaryweapon, "_" );
	self.pers[ "primaryWeapon" ] = primarytokens[ 0 ];
	/*
/#
	println( "^5GiveWeapon( " + weapon + " ) -- weapon" );
#/
	*/
	if ( primaryweapon != "" &amp;&amp; primaryweapon != "weapon_null_mp" &amp;&amp; primaryweapon != "weapon_null" )
	{
		if ( self hasperk( "specialty_extraammo" ) )
		{
			self givemaxammo( primaryweapon );
		}
		self giveweapon( primaryweapon, 0, primaryweaponoptions );
		spawnweapon = primaryweapon;
		initialweaponcount++;
	}
	if ( initialweaponcount &lt; 2 )
	{
		self giveweapon( "knife_held_mp", 0, knifeweaponoptions );
		if ( initialweaponcount == 0 )
		{
			spawnweapon = "knife_held_mp";
		}
	}
	if ( !isDefined( self.spawnweapon ) &amp;&amp; isDefined( self.pers[ "spawnWeapon" ] ) )
	{
		self.spawnweapon = self.pers[ "spawnWeapon" ];
	}
	if ( isDefined( self.spawnweapon ) &amp;&amp; doesweaponreplacespawnweapon( self.spawnweapon, spawnweapon ) &amp;&amp; !self.pers[ "changed_class" ] )
	{
		spawnweapon = self.spawnweapon;
	}
	self.pers[ "changed_class" ] = 0;
	/*
/#
	assert( spawnweapon != "" );
#/
	*/
	self.spawnweapon = spawnweapon;
	self.pers[ "spawnWeapon" ] = self.spawnweapon;
	self setspawnweapon( spawnweapon );
	grenadetypeprimary = self getloadoutitemref( class_num, "primarygrenade" );
	if ( isleagueitemrestricted( grenadetypeprimary ) )
	{
		grenadetypeprimary = "";
	}
	if ( maps/mp/killstreaks/_killstreaks::iskillstreakweapon( grenadetypeprimary + "_mp" ) )
	{
		grenadetypeprimary = "";
	}
	grenadetypesecondary = self getloadoutitemref( class_num, "specialgrenade" );
	if ( isleagueitemrestricted( grenadetypesecondary ) )
	{
		grenadetypesecondary = "";
	}
	if ( maps/mp/killstreaks/_killstreaks::iskillstreakweapon( grenadetypesecondary + "_mp" ) )
	{
		grenadetypesecondary = "";
	}
	if ( grenadetypeprimary != "" &amp;&amp; grenadetypeprimary != "weapon_null_mp" &amp;&amp; isequipmentallowed( grenadetypeprimary ) )
	{
		grenadetypeprimary += "_mp";
		primarygrenadecount = self getloadoutitem( class_num, "primarygrenadecount" );
	}
	if ( grenadetypesecondary != "" &amp;&amp; grenadetypesecondary != "weapon_null_mp" &amp;&amp; isequipmentallowed( grenadetypesecondary ) )
	{
		grenadetypesecondary += "_mp";
		grenadesecondarycount = self getloadoutitem( class_num, "specialgrenadecount" );
	}
	if ( grenadetypeprimary != "" &amp;&amp; grenadetypeprimary != "weapon_null_mp" &amp;&amp; !isequipmentallowed( grenadetypeprimary ) )
	{
		if ( grenadetypesecondary != level.weapons[ "frag" ] )
		{
			grenadetypeprimary = level.weapons[ "frag" ];
		}
		else
		{
			grenadetypeprimary = level.weapons[ "flash" ];
		}
	}
	/*
/#
	println( "^5GiveWeapon( " + grenadetypeprimary + " ) -- grenadeTypePrimary" );
#/
	*/
	self giveweapon( grenadetypeprimary );
	self setweaponammoclip( grenadetypeprimary, primarygrenadecount );
	self switchtooffhand( grenadetypeprimary );
	self.grenadetypeprimary = grenadetypeprimary;
	self.grenadetypeprimarycount = primarygrenadecount;
	if ( self.grenadetypeprimarycount &gt; 1 )
	{
		self dualgrenadesactive();
	}
	if ( grenadetypesecondary != "" &amp;&amp; grenadetypesecondary != "weapon_null_mp" &amp;&amp; isequipmentallowed( grenadetypesecondary ) )
	{
		self setoffhandsecondaryclass( grenadetypesecondary );
		/*
/#
		println( "^5GiveWeapon( " + grenadetypesecondary + " ) -- grenadeTypeSecondary" );
#/
		*/
		self giveweapon( grenadetypesecondary );
		self setweaponammoclip( grenadetypesecondary, grenadesecondarycount );
		self.grenadetypesecondary = grenadetypesecondary;
		self.grenadetypesecondarycount = grenadesecondarycount;
	}
	self bbclasschoice( class_num, primaryweapon, sidearm );
	if ( !sessionmodeiszombiesgame() )
	{
		for ( i = 0; i &lt; 3; i++ )
		{
			if ( level.loadoutkillstreaksenabled &amp;&amp; isDefined( self.killstreak[ i ] ) &amp;&amp; isDefined( level.killstreakindices[ self.killstreak[ i ] ] ) )
			{
				killstreaks[ i ] = level.killstreakindices[ self.killstreak[ i ] ];
			}
			else
			{
				killstreaks[ i ] = 0;
			}
		}
		self recordloadoutperksandkillstreaks( primaryweapon, sidearm, grenadetypeprimary, grenadetypesecondary, killstreaks[ 0 ], killstreaks[ 1 ], killstreaks[ 2 ] );
	}
	self maps/mp/teams/_teams::set_player_model( team, weapon );
	self initstaticweaponstime();
	self thread initweaponattachments( spawnweapon );
	self setplayerrenderoptions( playerrenderoptions );
	if ( isDefined( self.movementspeedmodifier ) )
	{
		self setmovespeedscale( self.movementspeedmodifier * self getmovespeedscale() );
	}
	if ( isDefined( level.givecustomloadout ) )
	{
		spawnweapon = self [[ level.givecustomloadout ]]();
		if ( isDefined( spawnweapon ) )
		{
			self thread initweaponattachments( spawnweapon );
		}
	}
	self cac_selector();
	if ( !isDefined( self.firstspawn ) )
	{
		if ( isDefined( spawnweapon ) )
		{
			self initialweaponraise( spawnweapon );
		}
		else
		{
			self initialweaponraise( weapon );
		}
	}
	else
	{
		self seteverhadweaponall( 1 );
	}
	self.firstspawn = 0;
	pixendevent();
}
</code></pre>
<pre><code>self calcweaponoptions( class_num, 2 ); //In the zombies function i shared earlier, class_num is taking the place of the camo_index arg. This doesn't exactly get me any closer.
</code></pre>
<p dir="auto">Thank you. Any help would be appreciated. Remember, i'm looking to <em>return</em> a camo. Not change one. If a player spawns in with a diamond camo, i wanna know that they have it through my scripts.</p>
]]></description><link>https://forum.plutonium.pw/topic/9434/grabbing-a-weapon-s-camo</link><generator>RSS for Node</generator><lastBuildDate>Sat, 16 May 2026 01:45:18 GMT</lastBuildDate><atom:link href="https://forum.plutonium.pw/topic/9434.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 09 Apr 2021 07:55:17 GMT</pubDate><ttl>60</ttl></channel></rss>