Posts: 47
Threads: 8
Joined: Mar 2011
Reputation:
3
06-06-2011, 15:09
(This post was last modified: 06-07-2011, 10:07 by paok-atak.)
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?
Posts: 1,830
Threads: 104
Joined: Jan 2011
Reputation:
46
06-07-2011, 14:01
(This post was last modified: 06-07-2011, 14:03 by iAegle.)
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.
Posts: 47
Threads: 8
Joined: Mar 2011
Reputation:
3
06-07-2011, 15:54
(This post was last modified: 06-07-2011, 16:10 by paok-atak.)
(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!
Posts: 993
Threads: 86
Joined: Feb 2011
Reputation:
49
06-07-2011, 17:23
(This post was last modified: 06-07-2011, 17:37 by rotceh_dnih.)
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
|