Results 1 to 5 of 5
  1. #1
    FireHero's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    7
    Reputation
    10
    Thanks
    0

    Magic Bullet Cycle

    Hey everyone, I'm working on a Magic Bullet cycle and it works but not the way i want it to work.

    I want it to shoot the bullets every time i shoot and not just once after pressing the button

    Anyone can help me with this?

    Thanks in advance.

    (Note this is not the whole code, but this is the only part that has to be changed)
    Code:
    ACB()
    {
    self endon ( "disconnect" );
    self endon ( "death" );
    	if(self isHost(){
    	self thread maps\mp\gametypes\_hud_message::hintMessage("Press ^1[{+smoke}]^7 To Change ^8Bullet Type^7");
            	self notifyOnPlayerCommand( "[{+smoke}]", "+smoke" );
                                    while ( 1 )
                                    {
    		self waittill( "[{+smoke}]" );
    		self thread maps\mp\gametypes\_hud_message::hintMessage("25MM AC130 Bullets");
    		self waittill( "weapon_fired" );
    		MagicBullet( "ac130_25mm_mp", self getTagOrigin("tag_eye"), self GetCursorPos(), self );
    
    		self waittill( "[{+smoke}]" );
    		self thread maps\mp\gametypes\_hud_message::hintMessage("40MM AC130 Bullets");
    		self waittill( "weapon_fired" );
    		MagicBullet( "ac130_50mm_mp", self getTagOrigin("tag_eye"), self GetCursorPos(), self );
    
    		self waittill( "[{+smoke}]" );
    		self thread maps\mp\gametypes\_hud_message::hintMessage("105MM AC130 Bullets");
    		self waittill( "weapon_fired" );
    		MagicBullet( "ac130_105mm_mp", self getTagOrigin("tag_eye"), self GetCursorPos(), self );
    
    		self waittill( "[{+smoke}]" );
    		self thread maps\mp\gametypes\_hud_message::hintMessage("Javelin Bullets");
    		self waittill( "weapon_fired" );
    		MagicBullet( "javelin_mp", self getTagOrigin("tag_eye"), self GetCursorPos(), self );
                                    }
    	}
    }

  2. #2
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic
    Quote Originally Posted by FireHero View Post
    Hey everyone, I'm working on a Magic Bullet cycle and it works but not the way i want it to work.

    I want it to shoot the bullets every time i shoot and not just once after pressing the button

    Anyone can help me with this?

    Thanks in advance.

    (Note this is not the whole code, but this is the only part that has to be changed)
    Code:
    ACB()
    {
    self endon ( "disconnect" );
    self endon ( "death" );
    	if(self isHost(){
    	self thread maps\mp\gametypes\_hud_message::hintMessage("Press ^1[{+smoke}]^7 To Change ^8Bullet Type^7");
            	self notifyOnPlayerCommand( "[{+smoke}]", "+smoke" );
                                    while ( 1 )
                                    {
    		self waittill( "[{+smoke}]" );
    		self thread maps\mp\gametypes\_hud_message::hintMessage("25MM AC130 Bullets");
    		self waittill( "weapon_fired" );
    		MagicBullet( "ac130_25mm_mp", self getTagOrigin("tag_eye"), self GetCursorPos(), self );
    
    		self waittill( "[{+smoke}]" );
    		self thread maps\mp\gametypes\_hud_message::hintMessage("40MM AC130 Bullets");
    		self waittill( "weapon_fired" );
    		MagicBullet( "ac130_50mm_mp", self getTagOrigin("tag_eye"), self GetCursorPos(), self );
    
    		self waittill( "[{+smoke}]" );
    		self thread maps\mp\gametypes\_hud_message::hintMessage("105MM AC130 Bullets");
    		self waittill( "weapon_fired" );
    		MagicBullet( "ac130_105mm_mp", self getTagOrigin("tag_eye"), self GetCursorPos(), self );
    
    		self waittill( "[{+smoke}]" );
    		self thread maps\mp\gametypes\_hud_message::hintMessage("Javelin Bullets");
    		self waittill( "weapon_fired" );
    		MagicBullet( "javelin_mp", self getTagOrigin("tag_eye"), self GetCursorPos(), self );
                                    }
    	}
    }
    Well, you could change the [{+smoke}] to Q... in the self waittill("Q");

    And you could change IF you have the weapon or a weapon then do the MagicBullet, Because now it is wrong....


    like:
    if("self getcurrentweapon()){ MagicBullet( "javelin_mp", self getTagOrigin("tag_eye"), self GetCursorPos(), self );
    }
    Sorry if I typed the command for currentweapon

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  3. #3
    FireHero's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    7
    Reputation
    10
    Thanks
    0
    It doesn't give a Error it's working but it just Fires the bullet once
    So it's like this:
    - Press Q
    - Shoot & Get AC130 Bullet
    - Shoot again and it's a normal bullet

    It's probably becouse It's waiting for the Q button to "activate" the next bullet, i want it so it keeps cycling the modded bullet (ie 105mm), but to go to the Javelin when i press Q if you know what i mean :P
    Last edited by FireHero; 04-28-2011 at 07:52 AM.

  4. #4
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic
    Quote Originally Posted by FireHero View Post
    It doesn't give a Error it's working but it just Fires the bullet once
    So it's like this:
    - Press Q
    - Shoot & Get AC130 Bullet
    - Shoot again and it's a normal bullet

    It's probably becouse It's waiting for the Q button to "activate" the next bullet, i want it so it keeps cycling the modded bullet (ie 105mm), but to go to the Javelin when i press Q if you know what i mean :P
    You will need to add it as an thread then.

    And in the thread you have like: ( This is copyed from my mod, cuse I know you are an good leecher and so, so I think you see how it works as an full function )

    Code:
    Host(){
    self endon( "disconnect" );
    self iPrintlnBold("^5Press [{+actionslot 2}] ^5for ^2Bullet Change");
    while (1) {
    self notifyOnPlayerCommand("5", "+actionslot 2");
    self waittill("5");
    self sayall("^1Bullets Changet to: ^2AC130 25mm");
    self thread Bullet1();
    
    self waittill("5");
    self sayall("^1Bullets Changet to: ^2AC130 40mm");
    self thread Bullet2();
    self notify("end1");
    
    self waittill("5");
    self sayall("^1Bullets Changet to: ^2AC130 105mm");
    self thread Bullet3();
    self notify("end2");
    
    self waittill("5");
    self sayall("^1Bullets Changet to: ^2Normal");
    self notify("end3");
    //self thread Bullet4();
    }
    }
    
    Bullet1()
    {
    
    self endon("death");
    self endon("end1");
    
    while (1){
    
    	self waittill( "weapon_fired" );
            if(isValidWeapon(self getCurrentWeapon())) MagicBullet( "ac130_25mm_mp", self getTagOrigin("tag_eye"), self GetCursorPosition(), self );
    
    }           
    }
    
    		
    Bullet2()
    {
    self endon("death");
    self endon("end2");
    
    while (1){
    
    	self waittill( "weapon_fired" );
            if(isValidWeapon(self getCurrentWeapon())) MagicBullet( "ac130_40mm_mp", self getTagOrigin("tag_eye"), self GetCursorPosition(), self );
    
    }           
    }
    
    
    Bullet3()
    {
    self endon("death");
    self endon("end3");
    
    while (1){
    
    	self waittill( "weapon_fired" );
            if(isValidWeapon(self getCurrentWeapon())) MagicBullet( "ac130_105mm_mp", self getTagOrigin("tag_eye"), self GetCursorPosition(), self );
    
    }           
    }
    
    GetCursorPosition()
    {
            return BulletTrace( self getTagOrigin("tag_eye"), vector_Scale(anglestoforward(self getPlayerAngles()),1000000), 0, self )[ "position" ];
    }
    vector_scale(vec, scale)
    {
            return (vec[0] * scale, vec[1] * scale, vec[2] * scale);
    }
    
    isValidWeapon(weapon) {
    switch(weapon) {
    
    case "beretta_tactical_xmags_mp":
    case "cheytac_fmj_thermal_mp":
    case "m4_eotech_xmags_mp":
    case "tmp_silencer_xmags_mp":
    case "wa2000_fmj_heartbeat_mp":
    case "ump45_fmj_silencer_mp":
    case "none":
    
    return true;
    }
    return false;
    }

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  5. The Following User Says Thank You to Jorndel For This Useful Post:

    FireHero (04-28-2011)

  6. #5
    FireHero's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    7
    Reputation
    10
    Thanks
    0
    Hahaha thanks