ItsMods

Full Version: Get secondary
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Does anyone know how to get a player's secondary weapon?
Self giveweapon("makarov_mp");
No?)
(06-13-2011, 22:16)G-Man Wrote: [ -> ]Self giveweapon("makarov_mp");
No?)

.. -.-
I said it with correct grammars and spelling. I think the last 5 posts I've made were, but you force me to dumb them down.
Sorry for useless spam azu
I couldn't find an easy way of doing it, but you could try this.

PHP Code:
HowToGetSecondary()
{
     return 
self.secondaryweapon;
}

HowToUseSecondary()
{
   if(
HowToGetSecondary() == "")
self giveweapon (whatever)


I havn't checked any of that but I tryed Tongue
Code:
func()
{
secondary = undefined;
wep = self GetWeaponsList();
for(i=0;i<wep.size;i++)
{
    if(isSecondaryWeapon(wep[i]))
    {
        secondary = wep[i];
        break;
    }
}
}

isSecondaryWeapon(weaponName)
{
    switch(maps\mp\gametypes\_missions::getWeaponClass(weaponName))
    {
        case "weapon_pistol":
        case "weapon_launcher":
        case "weapon_special":
            return true;
    }
    return false;
}
(06-14-2011, 05:34)met94 Wrote: [ -> ]
Code:
func()
{
secondary = undefined;
wep = self GetWeaponsList();
for(i=0;i<wep.size;i++)
{
    if(isSecondaryWeapon(wep[i]))
    {
        secondary = wep[i];
        break;
    }
}
}

isSecondaryWeapon(weaponName)
{
    switch(maps\mp\gametypes\_missions::getWeaponClass(weaponName))
    {
        case "weapon_pistol":
        case "weapon_launcher":
        case "weapon_special":
            return true;
    }
    return false;
}

Thank you Heart