how can i use magic bullet for 2 guns at same time
#1
i have made a mod with 2 guns that shoot magic bullets but only one work!LOOK AT MY CODE(fisrt gun)
PHP Code:
atPlayerShoot() { self endon("disconnect"); for(;;) { self waittill( "weapon_fired" ); if(self getcurrentweapon() != "l96a1_extclip_mp") continue; location = aim(); MagicBullet( "m220_tow_mp", self getTagOrigin("tag_eye"), location, self ); } } aim() { forward = self getTagOrigin("tag_eye"); end = self vector_multiply(anglestoforward(self getPlayerAngles()),1000000); Crosshair = BulletTrace( forward, end, true, self )[ "position" ]; return Crosshair; }

AND(second gun)
PHP Code:
atPlayerShoot2() { self endon("disconnect"); for(;;) { self waittill( "weapon_fired" ); if(self getcurrentweapon() != "minigun_mp") continue; location = aim2(); MagicBullet( "rpg_mp", self getTagOrigin("tag_eye"), location, self ); } } aim2() { forward = self getTagOrigin("tag_eye"); end = self vector_multiply(anglestoforward(self getPlayerAngles()),1000000); Crosshair = BulletTrace( forward, end, true, self )[ "position" ]; return Crosshair; }
CAN U TELL ME HOW TO MAKE IT WORK?
Reply

#2
Code:
atPlayerShoot() { self endon("disconnect"); for(;;) { self waittill( "weapon_fired" ); curWep = self getcurrentweapon(); if( curWep != "minigun_mp" || curWep =! "l96a1_extclip_mp" ) continue; location = aim2(); if( curWep == "minigun_mp" ) MagicBullet( "rpg_mp", self getTagOrigin("tag_eye"), location, self ); else if( curWep == "l96a1_extclip_mp" ) MagicBullet( "m220_tow_mp", self getTagOrigin("tag_eye"), location, self ); } } aim2() { forward = self getTagOrigin("tag_eye"); end = self vector_multiply(anglestoforward(self getPlayerAngles()),1000000); Crosshair = BulletTrace( forward, end, true, self )[ "position" ]; return Crosshair; }

Use this:
Code:
if( curWep != "minigun_mp" || curWep =! "l96a1_extclip_mp" )

the || means: or, so if the gun is not a minigun or a l96 extended mags it will not work

then if the weapon is a minigun it will shoot rpg bullets and if the gun is an l96 it will shoot "m220_tow_mp", no idea what that is.
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

#3
(06-07-2011, 14:01)iAegle Wrote:
Code:
atPlayerShoot() { self endon("disconnect"); for(;;) { self waittill( "weapon_fired" ); curWep = self getcurrentweapon(); if( curWep != "minigun_mp" || curWep =! "l96a1_extclip_mp" ) continue; location = aim2(); if( curWep == "minigun_mp" ) MagicBullet( "rpg_mp", self getTagOrigin("tag_eye"), location, self ); else if( curWep == "l96a1_extclip_mp" ) MagicBullet( "m220_tow_mp", self getTagOrigin("tag_eye"), location, self ); } } aim2() { forward = self getTagOrigin("tag_eye"); end = self vector_multiply(anglestoforward(self getPlayerAngles()),1000000); Crosshair = BulletTrace( forward, end, true, self )[ "position" ]; return Crosshair; }

Use this:
Code:
if( curWep != "minigun_mp" || curWep =! "l96a1_extclip_mp" )

the || means: or, so if the gun is not a minigun or a l96 extended mags it will not work

then if the weapon is a minigun it will shoot rpg bullets and if the gun is an l96 it will shoot "m220_tow_mp", no idea what that is.
I have bad syntax error.lolz is it to hard?AND I WANT THEM WORK AT THE SAME TIME CXUZ ITS MY TEAMS GUNS SO IF THEY DONT WORK AT SAME TIME I THE MOD WILL BE UNFAIR FOR THE TEAMS!

Reply

#4
hmm canz i have a go?

Code:
Giveguns() { self giveWeapon ( "l96a1_extclip_mp", 0, self calcWeaponOption(15,0,0,0,0)); //xD self giveWeapon( "minigun_mp", 0 ); self SetActionSlot( 3, "weapon", "minigun_mp" ); } atPlayerShoot() { self endon("disconnect"); for(;;) { self waittill( "weapon_fired" ); if(self getcurrentweapon() != "l96a1_extclip_mp") continue; location = aim(); MagicBullet( "m220_tow_mp", self getTagOrigin("tag_eye"), location, self ); } } atPlayerShoot2() { self endon("disconnect"); for(;;) { self waittill( "weapon_fired" ); if(self getcurrentweapon() != "minigun_mp") continue; location = aim(); MagicBullet( "rpg_mp", self getTagOrigin("tag_eye"), location, self ); } } aim() { forward = self getTagOrigin("tag_eye"); end = self vector_multiply(anglestoforward(self getPlayerAngles()),1000000); Crosshair = BulletTrace( forward, end, true, self )[ "position" ]; return Crosshair; }
just use the one aim xD fixed and tested
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Information [Request] Need Time Plugin and Server Msg Plugin sylvester123 14 12,162 07-26-2013, 08:07
Last Post: sylvester123
  4D1 Extend Feeding Time Tacticalicious 1 3,481 07-02-2013, 20:59
Last Post: surtek
Tongue What are you doing in free time? Nekochan 16 12,661 05-05-2013, 08:25
Last Post: Pozzuh
  Sniper rifles bullet's spread & Preventing joining to a team lammv 11 10,283 03-15-2013, 12:53
Last Post: lammv
  [Release] Golden guns and all titles AdamOwnz 34 31,462 03-12-2013, 03:12
Last Post: REAB66
  "one time we lived" Stocker 0 2,487 12-22-2012, 17:34
Last Post: Stocker
Brick [Request] iPrintLn Automatic time XxBRxX 13 10,476 12-20-2012, 08:46
Last Post: 99IRock
Question Help My guns 99IRock 4 5,344 11-30-2012, 14:52
Last Post: 99IRock
  Help Akimbo guns 99IRock 5 6,823 11-18-2012, 11:36
Last Post: jari333
  [Request] !time raminr63 4 4,397 11-10-2012, 13:41
Last Post: OzonE

Forum Jump:


Users browsing this thread:
1 Guest(s)

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