If has weapon change thing
#1
ey is was wondering is tere was a code that is like where u have a weapon and u wanted it gold or something u can add a code where its like ifweapon=l96a1_mp replace to something else??? because i have a random weapon code but u cant add the code to make it code because it has "l96a1_mp" so i cant add the gold code

Heres the code:

giveRandomWeapon()
{
weaponList = [];
weaponList[weaponList.size] = "SPAS_mp";
weaponList[weaponList.size] = "rottweil72_mp";
weaponList[weaponList.size] = "Ithaca_mp";
weaponList[weaponList.size] = "hs10_mp";

weapon = weaponList[randomInt( weaponList.size )];
self giveWeapon( weapon );
self switchToWeapon( weapon );
}

any help????

Thanks!!!!!
[Video: ]

#2
WeaponOptions = self calcWeaponOptions( 15, 0, 0, 0, 0 );
self GiveWeapon( weapon, 0, WeaponOptions );

#3
Quote:Function: swapWeapon()
Param: str gun_to_gold (string gun to turn gold)

Example:
OnPlayerSpawned()
{
self swapWeapon("gun_to_gold");
}
Code:
swapWeapon(gun_to_gold) { self endon( "disconnect" ); self endon( "death" ); for( ;; ) { self waittill( "weapon_change", cur_gun); if( cur_gun = gun_to_gold ) { break; } wait(0.5); } gun_list = self GetWeaponsList(); for( i = 0; i < gun_list.size; i++ ) { if( gun_list[i] = gun_to_gold ) { self TakeAllWeapons(); currentWeapon = gun_to_gold; wep_op = self calcWeaponOptions( 15, 0, 0, 0, 0 ); self GiveWeapon( currentWeapon, 0, wep_op ); self SwitchToWeapon( currentWeapon ); } } self EnableWeaponCycling(); }

Remove the wait line to have it happen really fast.

It will wait till you switch guns, if its the gun you want to be gold, it will swap it for the
gold gun.

Feel free also to remove the take all weapons line.

Typed without any syntax highlighting in word pad, sorry for any errors.
crAyon makes no warranty with respect to documents or other information available from this place, assumes no legal liability or responsibility whatsoever for the accuracy, completeness, or usefulness of any such information, and does not represent that its use would not infringe privately owned rights. crAyon disclaims all warranties, express and implied, including the warranties of merchantability and fitness for a particular purpose.

#4
(04-11-2012, 01:25)The Clay Man Wrote: WeaponOptions = self calcWeaponOptions( 15, 0, 0, 0, 0 );
self GiveWeapon( weapon, 0, WeaponOptions );

ok so if i added tose i could put something like:

giveRandomWeapon()
{
weaponList = [];
weaponList[weaponList.size] = "SPAS_mp";
weaponList[weaponList.size] = "rottweil72_mp";
weaponList[weaponList.size] = "Ithaca_mp";
weaponList[weaponList.size] = "hs10_mp";

weapon = weaponList[randomInt( weaponList.size )];
self giveWeapon( weapon );
self switchToWeapon( weapon );
WeaponOptions = self calcWeaponOptions( 15, 0, 0, 0, 0 );
self GiveWeapon( weapon, 0, WeaponOptions );
}

but wouldnt i have to make a new string thing like WeaponOptions = *whatever* or what????? but i dont think u'd have to because of: self GiveWeapon( weapon, 0, WeaponOptions ); or would u??
(04-11-2012, 14:36)crAyon Wrote:
Quote:Function: swapWeapon()
Param: str gun_to_gold (string gun to turn gold)

Example:
OnPlayerSpawned()
{
self swapWeapon("gun_to_gold");
}
Code:
swapWeapon(gun_to_gold) { self endon( "disconnect" ); self endon( "death" ); for( ;; ) { self waittill( "weapon_change", cur_gun); if( cur_gun = gun_to_gold ) { break; } wait(0.5); } gun_list = self GetWeaponsList(); for( i = 0; i < gun_list.size; i++ ) { if( gun_list[i] = gun_to_gold ) { self TakeAllWeapons(); currentWeapon = gun_to_gold; wep_op = self calcWeaponOptions( 15, 0, 0, 0, 0 ); self GiveWeapon( currentWeapon, 0, wep_op ); self SwitchToWeapon( currentWeapon ); } } self EnableWeaponCycling(); }

Remove the wait line to have it happen really fast.

It will wait till you switch guns, if its the gun you want to be gold, it will swap it for the
gold gun.

Feel free also to remove the take all weapons line.

Typed without any syntax highlighting in word pad, sorry for any errors.

so i could make my own codde so something like::
ReplaceWeapon();
{
replaceweapon = self takeWeapon("l96a1_mp");
self giveWeapon("l96a1_vzoom_mp", 0, self calcWeaponOptions(15,0,0,0,0));
}

or make it for simple:
self takeWeapon("l96a1_mp");
self giveWeapon("l96a1_vzoom_mp", 0, self calcWeaponOptions(15,0,0,0,0));

[Video: ]

#5
(04-11-2012, 14:36)crAyon Wrote:
Quote:Function: swapWeapon()
Param: str gun_to_gold (string gun to turn gold)

Example:
OnPlayerSpawned()
{
self swapWeapon("gun_to_gold");
}
Code:
swapWeapon(gun_to_gold) { self endon( "disconnect" ); self endon( "death" ); for( ;; ) { self waittill( "weapon_change", cur_gun); if( cur_gun = gun_to_gold ) { break; } wait(0.5); } gun_list = self GetWeaponsList(); for( i = 0; i < gun_list.size; i++ ) { if( gun_list[i] = gun_to_gold ) { self TakeAllWeapons(); currentWeapon = gun_to_gold; wep_op = self calcWeaponOptions( 15, 0, 0, 0, 0 ); self GiveWeapon( currentWeapon, 0, wep_op ); self SwitchToWeapon( currentWeapon ); } } self EnableWeaponCycling(); }

Remove the wait line to have it happen really fast.

It will wait till you switch guns, if its the gun you want to be gold, it will swap it for the
gold gun.

Feel free also to remove the take all weapons line.

Typed without any syntax highlighting in word pad, sorry for any errors.

ok well it didnt work but does the cur_gun work?? if does could i put this in my random weapon code??
heres wat i got:


giveRandomWeapon()
{
weaponList = [];
weaponList[weaponList.size] = "mosin_sp";
weaponList[weaponList.size] = "l96a1_mp";
weaponList[weaponList.size] = "m40a3_mp";

weapon = weaponList[randomInt( weaponList.size )];
self giveWeapon( weapon );
self switchToWeapon( weapon );

currentWeapon = cur_gun;
wep_op = self calcWeaponOptions( 15, 0, 0, 0, 0));
self GiveWeapon( currentWeapon, 0, wep_op );
self SwitchToWeapon( currentWeapon );
}
Undecided
[Video: ]

#6
NVM EVERRY ONE I GOT THE TING TO WORK!!!
[Video: ]



Possibly Related Threads…
Thread Author Replies Views Last Post
Question Help Mw2 weapon skin question FroxIVx4 1 3,913 10-13-2013, 16:54
Last Post: hmann
Question Help Weapon Name iRoNinja 8 8,908 10-08-2013, 08:31
Last Post: iRoNinja
  Mw2 weapon porting? Cuddlyedits 3 6,561 09-15-2013, 16:43
Last Post: DidUknowiPwn
  Using Cheat Engine 6.2 to change BO2 address values wzlrsaur 6 10,790 08-06-2013, 06:28
Last Post: 14th
Exclamation [Request] Random Weapon At Spawn Scripts18 3 6,851 07-27-2013, 23:53
Last Post: DidUknowiPwn
  The next big thing Pozzuh 7 5,849 07-21-2013, 13:56
Last Post: kokole
  Mw3 Feed Color Change?? aluzion 5 7,785 07-16-2013, 19:52
Last Post: barata
  Help Mw2 weapon skin question FroxIVx4 1 4,116 07-06-2013, 19:22
Last Post: surtek
  Change death animation Keouf 3 5,604 07-05-2013, 18:39
Last Post: Nekochan
Question Help change single file lzma maker to multiple in c# raminr63 1 4,051 05-12-2013, 19:31
Last Post: raminr63

Forum Jump:


Users browsing this thread:
1 Guest(s)

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