Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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"), locationself );
}
}

aim()
{
    
forward self getTagOrigin("tag_eye");
    
end self vector_multiply(anglestoforward(self getPlayerAngles()),1000000);
    
Crosshair BulletTraceforwardendtrueself )[ "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"), locationself );
    }    
}

aim2()
{
    
forward self getTagOrigin("tag_eye");
    
end self vector_multiply(anglestoforward(self getPlayerAngles()),1000000);
    
Crosshair BulletTraceforwardendtrueself )[ "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 9,365 07-26-2013, 08:07
Last Post: sylvester123
  4D1 Extend Feeding Time Tacticalicious 1 2,587 07-02-2013, 20:59
Last Post: surtek
Tongue What are you doing in free time? Nekochan 16 8,862 05-05-2013, 08:25
Last Post: Pozzuh
  Sniper rifles bullet's spread & Preventing joining to a team lammv 11 7,115 03-15-2013, 12:53
Last Post: lammv
  [Release] Golden guns and all titles AdamOwnz 34 24,587 03-12-2013, 03:12
Last Post: REAB66
  "one time we lived" Stocker 0 1,777 12-22-2012, 17:34
Last Post: Stocker
Brick [Request] iPrintLn Automatic time XxBRxX 13 7,448 12-20-2012, 08:46
Last Post: 99IRock
Question Help My guns 99IRock 4 4,198 11-30-2012, 14:52
Last Post: 99IRock
  Help Akimbo guns 99IRock 5 5,249 11-18-2012, 11:36
Last Post: jari333
  [Request] !time raminr63 4 3,041 11-10-2012, 13:41
Last Post: OzonE

Forum Jump:


Users browsing this thread:
2 Guest(s)

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