SA-MP Forums Archive
GetWeaponNameEx - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: GetWeaponNameEx (/showthread.php?tid=604153)



GetWeaponNameEx - ScIrUsna - 01.04.2016

Hi,

Код:
stock GetWeaponNameEx(weaponid, weapon[], len = sizeof(weapon))
{
    switch(weaponid)
    {
        case 18: strcat(weapon, "Molotov Cocktail", len);
        case 44: strcat(weapon, "Night Vision Goggles", len);
        case 45:  strcat(weapon, "Thermal Goggles", len);
        default: GetWeaponName(weaponid, weapon, len);
    }
    return weapon
}
It can return string?


Re: GetWeaponNameEx - ayoub001 - 01.04.2016

GetWeaponName(weaponid, const weapon[], len)

weaponid: The ID of the weapon to get the name of.
const weapon[]: An array to store the weapon's name in, passed by reference.
len :The maximum length of the weapon name to store. Should be sizeof(name).

use this


Re: GetWeaponNameEx - introzen - 01.04.2016

Quote:
Originally Posted by ScIrUsna
Посмотреть сообщение
Hi,

Код:
stock GetWeaponNameEx(weaponid, weapon[], len = sizeof(weapon))
{
    switch(weaponid)
    {
        case 18: strcat(weapon, "Molotov Cocktail", len);
        case 44: strcat(weapon, "Night Vision Goggles", len);
        case 45:  strcat(weapon, "Thermal Goggles", len);
        default: GetWeaponName(weaponid, weapon, len);
    }
    return weapon
}
It can return string?
Yes, it does return the string formatted accordingly to what weaponid you input to the function.


Re: GetWeaponNameEx - xTURBOx - 01.04.2016

try this
PHP код:
stock GetWeaponNameEx(weaponidweapon[], len sizeof(weapon))
{
    switch(
weaponid)
    {
        case 
18weapon "Molotov Cocktail";
        case 
44weapon "Night Vision Goggles";
        case 
45weapon "Thermal Goggles";
        default: 
GetWeaponName(weaponidweaponlen);
    }
    return 
weapon;