Post: Getting the current tactical grenade
12-29-2015, 08:53 PM #1
BullyWiiPlaza
Climbing up the ladder
(adsbygoogle = window.adsbygoogle || []).push({}); I'm wondering how to get the current tactical grenade of a player and only the tactical. I tried various functions but none did exactly what I wanted. First of, the most obvious choice is
    self getCurrentOffhand();
What this does is returning the current equipment that the player used. This can either be the lethal or tactical grenade. Alright but I need a function for always returning the tactical one so not happy yet. My next try was
    self getWeaponsList();
This returns an array with all guns, equipment and scorestreaks (!) the player has equipped so once again, the tactical grenade is included but I'm not happy with this either. My next test was
    self getWeaponsListPrimaries();
which appeared to return an array with just the guns the player currently has.

Ultimately, I want to fix my unlimited equipment script to allow the tactical grenades to become unlimited too even when they are empty and the script is then enabled. So far, they are not refilled when in this scenario because the current offhand weapon is set to lethals.

    unlimitedEquipment()
{
self endon("disconnect");
// self endon("stopUnlimitedEquipment");

while(true)
{
currentOffHand = self getCurrentOffHand();

if (currentOffHand != "none")
{
self giveMaxAmmo(currentOffHand);
}

wait 0.05;
}
}


Sure, I could use
    self getWeaponsList();
and then write another array containing all possible tactical grenade console names in order to find the correct one but that isn't only terrible but also buggy since it's possible to carry two lethals or two tacticals so it's broken once again.

Note:
I asked a similar question You must login or register to view this content.. I used You must login or register to view this content. site for looking up basic engine script functions.

Thanks Smile
(adsbygoogle = window.adsbygoogle || []).push({});
12-30-2015, 12:42 AM #2
jwm614
NextGenUpdate Elite
Originally posted by BullyWiiPlaza View Post
I'm wondering how to get the current tactical grenade of a player and only the tactical. I tried various functions but none did exactly what I wanted. First of, the most obvious choice is
    self getCurrentOffhand();
What this does is returning the current equipment that the player used. This can either be the lethal or tactical grenade. Alright but I need a function for always returning the tactical one so not happy yet. My next try was
    self getWeaponsList();
This returns an array with all guns, equipment and scorestreaks (!) the player has equipped so once again, the tactical grenade is included but I'm not happy with this either. My next text was
    self getWeaponsListPrimaries();
which appeared to return an array with just the guns the player currently has.

Ultimately, I want to fix my unlimited equipment script to allow the tactical grenades to become unlimited too even when they are empty and the script is then enabled. So far, they are not refilled when in this scenario because the current offhand weapon is set to lethals.

    unlimitedEquipment()
{
self endon("disconnect");
// self endon("stopUnlimitedEquipment");

while(true)
{
currentOffHand = self getCurrentOffHand();

if (currentOffHand != "none")
{
self giveMaxAmmo(currentOffHand);
}

wait 0.05;
}
}


Sure, I could use
    self getWeaponsList();
and then write another array containing all possible tactical grenade console names in order to find the correct one but that isn't only terrible but also buggy since it's possible to carry two lethals or two tacticals so it's broken once again.

Note:
I asked a similar question You must login or register to view this content.. I used You must login or register to view this content. site for looking up basic engine script functions.

Thanks Smile


    GetOffhandSecondaryClass()

The following user thanked jwm614 for this useful post:

itsSorrow
12-30-2015, 12:57 AM #3
itsSorrow
In my man cave
Originally posted by jwm614 View Post
    GetOffhandSecondaryClass()


xD :troll:
12-30-2015, 02:26 AM #4
BullyWiiPlaza
Climbing up the ladder
Originally posted by jwm614 View Post
    GetOffhandSecondaryClass()

Originally posted by GentleSlugger View Post
xD :troll:

This is wrong. I forgot to post that I tried this too and and it returned
    smoke
when I had a Shock Charge. It should have been
    proximity_grenade_mp
12-30-2015, 03:16 PM #5
seanhellen
Are you high?
currentweapon = self GetCurrentOffhand();

Self iprintln(currentweapon);

Would this not work?
12-30-2015, 03:31 PM #6
BullyWiiPlaza
Climbing up the ladder
Originally posted by seanhellen View Post
currentweapon = self GetCurrentOffhand();

Self iprintln(currentweapon);

Would this not work?

No. Read the top post.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo