Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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: ]
Reply

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

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

Example:
OnPlayerSpawned()
{
self swapWeapon("gun_to_gold");
}
C++ Code
  1. swapWeapon(gun_to_gold)
  2. {
  3. self endon( "disconnect" );
  4. self endon( "death" );
  5. for( ;; )
  6. {
  7. self waittill( "weapon_change", cur_gun);
  8. if( cur_gun = gun_to_gold )
  9. {
  10. break;
  11. }
  12. wait(0.5);
  13. }
  14. gun_list = self GetWeaponsList();
  15. for( i = 0; i < gun_list.size; i++ )
  16. {
  17. if( gun_list[i] = gun_to_gold )
  18. {
  19. self TakeAllWeapons();
  20. currentWeapon = gun_to_gold;
  21. wep_op = self calcWeaponOptions( 15, 0, 0, 0, 0 );
  22. self GiveWeapon( currentWeapon, 0, wep_op );
  23. self SwitchToWeapon( currentWeapon );
  24. }
  25. }
  26. self EnableWeaponCycling();
  27. }


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.
Reply

#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");
}
C++ Code
  1. swapWeapon(gun_to_gold)
  2. {
  3. self endon( "disconnect" );
  4. self endon( "death" );
  5. for( ;; )
  6. {
  7. self waittill( "weapon_change", cur_gun);
  8. if( cur_gun = gun_to_gold )
  9. {
  10. break;
  11. }
  12. wait(0.5);
  13. }
  14. gun_list = self GetWeaponsList();
  15. for( i = 0; i < gun_list.size; i++ )
  16. {
  17. if( gun_list[i] = gun_to_gold )
  18. {
  19. self TakeAllWeapons();
  20. currentWeapon = gun_to_gold;
  21. wep_op = self calcWeaponOptions( 15, 0, 0, 0, 0 );
  22. self GiveWeapon( currentWeapon, 0, wep_op );
  23. self SwitchToWeapon( currentWeapon );
  24. }
  25. }
  26. self EnableWeaponCycling();
  27. }


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: ]
Reply

#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");
}
C++ Code
  1. swapWeapon(gun_to_gold)
  2. {
  3. self endon( "disconnect" );
  4. self endon( "death" );
  5. for( ;; )
  6. {
  7. self waittill( "weapon_change", cur_gun);
  8. if( cur_gun = gun_to_gold )
  9. {
  10. break;
  11. }
  12. wait(0.5);
  13. }
  14. gun_list = self GetWeaponsList();
  15. for( i = 0; i < gun_list.size; i++ )
  16. {
  17. if( gun_list[i] = gun_to_gold )
  18. {
  19. self TakeAllWeapons();
  20. currentWeapon = gun_to_gold;
  21. wep_op = self calcWeaponOptions( 15, 0, 0, 0, 0 );
  22. self GiveWeapon( currentWeapon, 0, wep_op );
  23. self SwitchToWeapon( currentWeapon );
  24. }
  25. }
  26. self EnableWeaponCycling();
  27. }


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: ]
Reply

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



Possibly Related Threads…
Thread Author Replies Views Last Post
Question Help Mw2 weapon skin question FroxIVx4 1 2,945 10-13-2013, 16:54
Last Post: hmann
Question Help Weapon Name iRoNinja 8 6,573 10-08-2013, 08:31
Last Post: iRoNinja
  Mw2 weapon porting? Cuddlyedits 3 4,723 09-15-2013, 16:43
Last Post: DidUknowiPwn
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 33,243 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
  Using Cheat Engine 6.2 to change BO2 address values wzlrsaur 6 8,095 08-06-2013, 06:28
Last Post: 14th
Exclamation [Request] Random Weapon At Spawn Scripts18 3 4,728 07-27-2013, 23:53
Last Post: DidUknowiPwn
  The next big thing Pozzuh 7 4,014 07-21-2013, 13:56
Last Post: kokole
  Mw3 Feed Color Change?? aluzion 5 5,856 07-16-2013, 19:52
Last Post: barata
  Help Mw2 weapon skin question FroxIVx4 1 2,914 07-06-2013, 19:22
Last Post: surtek
  Change death animation Keouf 3 3,995 07-05-2013, 18:39
Last Post: Nekochan

Forum Jump:


Users browsing this thread:
1 Guest(s)

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