Gun name to id
#8

I would appreciate it if you told me what warnings you're getting. If you want just the stock, here:

pawn Код:
stock GetWeaponID(weaponName[], bool: ignoreCase = true, bool: useFind = false)
{
    new weaponID = -1;
    if(useFind == false)
    {
        for(new i = 0, sof = sizeof(svAddons_WeaponNames); i < sof; i++)
        {
            if(!strcmp(svAddons_WeaponNames[i], weaponName, ignoreCase))
            {
                weaponID = i;
                break;
            }
        }
    }
    else if(useFind == true)
    {
        for(new i = 0, sof = sizeof(svAddons_WeaponNames); i < sof; i++)
        {
            if(strfind(svAddons_WeaponNames[i], weaponName, ignorecase) > -1)
            {
                weaponID = i;
                break;
            }
        }
    }
    return weaponID;
}
Reply


Messages In This Thread
Gun name to id - by SnG.Scot_MisCuDI - 12.07.2012, 02:03
Re: Gun name to id - by SuperViper - 12.07.2012, 02:04
Re: Gun name to id - by SnG.Scot_MisCuDI - 12.07.2012, 02:08
Re: Gun name to id - by SuperViper - 12.07.2012, 02:09
Re: Gun name to id - by SnG.Scot_MisCuDI - 12.07.2012, 02:11
Re: Gun name to id - by SuperViper - 12.07.2012, 02:13
Re: Gun name to id - by SnG.Scot_MisCuDI - 12.07.2012, 02:21
Re: Gun name to id - by SuperViper - 12.07.2012, 02:23
Re: Gun name to id - by SnG.Scot_MisCuDI - 12.07.2012, 02:32
Re: Gun name to id - by SuperViper - 12.07.2012, 02:37

Forum Jump:


Users browsing this thread: 1 Guest(s)