I want to get the weapon name that corresponds to the given weapon, so if the weapon is "weapon_mp5navy", I would get "Balrog Ethereal". Ignore the other things in the array, because this isn't the full code of the plugin.
So, I changed it like this now:
PHP Code:
public _furien_get_weaponname(PluginIndex, PluginParams)
{
new szWeapon[32], i
get_string(PluginParams, szWeapon, charsmax(szWeapon))
for(i = 0; i < sizeof(g_szModels) - 3; i += 4)
{
if(equali(szWeapon, g_szModels[i]))
{
set_string(2, g_szModels[i + 1], get_param(2))
break
}
}
return 1
}
And the native is:
PHP Code:
native furien_get_weaponname(szWeapon[], szString[], const iMax)
The test function:
PHP Code:
public test(id)
{
new szName[32]
furien_get_weaponname("weapon_mp5navy", szName, charsmax(szName))
client_print(id, print_chat, "The name is %s", szName)
}
I'm still not getting the desired name.
This is what I'm trying to do -
http://i.imgur.com/RS7k4sa.jpg
I made the image with a simple array of strings in the same plugin, but I want to add the name in my other plugin, where all the weapon models are.