Magic Bullet Cycle

Posts 1–5 of 5 · Page 1 of 1
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 );
                                }
	}
}
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
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
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;
}
Hahaha thanks
Posts 1–5 of 5 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Talk with us