UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

[Black ops 1] [Help] waittill left hand weapon fired?

broken avatar :(
Created 8 years ago
by Deleted User
0 Members and 1 Guest are viewing this topic.
2,085 views
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
so im trying to script the RayGun MK 3 but i cant seem to figure out how to detemine which weapon you fired (left or right hand) since GetCurrentWeapon() always returns the right hand and "weapon_fired" notify doesnt give the weapon fired

i mean ive tested with the left hand side of MK 3 being executed when i shoot the m1911 and it works fine but i just cant get it to work from firing the MK 3 left hand :(

ive tried to make my own notify but again for somereason it only works on right hand weapon, left hand never gets notified (right hand only ever gets print out)

Code Snippet
Plaintext
// <player> thread dualwield_weapon_fired_notify_think(<weapon>);
// <player> thread dualwield_weapon_fired_notify_think("m1911_upgraded_zm");
// <player> thread dualwield_weapon_fired_notify_think("m1911lh_upgraded_zm");

dualwield_weapon_fired_notify_think(weapon)
{
self endon("disconnect");

ammo = 0;

max_clip = WeaponClipSize(weapon);
max_stock = WeaponMaxAmmo(weapon);

for(;;)
{
wait .05;

if(!self HasWeapon(weapon))
{
while(!self HasWeapon(weapon))
{
wait .05;
}

ammo = self GetWeaponAmmoClip(weapon) + self GetWeaponAmmoStock(weapon); // reset ammo since it should be a new instance of the weapon (just bought / obtained)

continue;
}

result = self waittill_any_return("weapon_fired", "reload_start");

clip = self GetWeaponAmmoClip(weapon);
stock = self GetWeaponAmmoStock(weapon);

if(result == "reload_start")
{
str_result = self waittill_any_return("reload", "weapon_change");

if(str_result == "weapon_change")
continue;

ammo = max_clip + max_stock; // FIXME: maybe this should be max_clip + stock (max + current)
}
else
{
test_ammo = clip + stock;

if(ammo < test_ammo)
{
ammo = test_ammo;

self notify("dualwield_weapon_fired", weapon);
IPrintLn(weapon);
}
}
}
}
broken avatar :(
×
broken avatar :(
Location: usUnion, Kentucky
Date Registered: 9 September 2013
Last active: 1 year ago
Posts
310
Respect
Forum Rank
Perk Hacker
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
lilrifa's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
lilrifa's Contact & Social Linksskypeuser724lilrifalilrifa
I would set it up as a projectile weapon, and write the script revolving around that concept.
Marked as best answer by Deleted User 8 years ago
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
How are you firing the left weapon, ads? Why not look for that and check the right side gun. I assume you can only have a certain gun in right and left hands?

ps, didn't notice it said bo1, oops
Last Edit: August 22, 2016, 01:50:45 am by MakeCents
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
How are you firing the left weapon, ads? Why not look for that and check the right side gun. I assume you can only have a certain gun in right and left hands?

ps, didn't notice it said bo1, oops

after a good nights rest and reading what MakeCents said i dawned on me how simple this is, just a normal waittill weapon fired but check if ADS button is pressed and now it works perfectly

Code if you want to know the BTS but its very simple
Code Snippet
Plaintext
dualwield_weapon_fired_notify_think(weapon, weapon_upgraded, lh_weapon, lh_weapon_upgraded)
{
self endon("disconnect");

for(;;)
{
self waittill("weapon_fired");

current_weapon = self GetCurrentWeapon();

if(current_weapon == weapon || current_weapon == weapon_upgraded)
{
if(self ADSButtonPressed())
{
if(current_weapon == weapon_upgraded)
self notify("dualwield_weapon_fired", lh_weapon_upgraded);
else
self notify("dualwield_weapon_fired", lh_weapon);
}
else
self notify("dualwield_weapon_fired", current_weapon); // use current weapon so you know if its upgraded or not
}
}
}

Marked MakeCents as best answer but this is also part of the answer

 
Loading ...