PHP Code:
new const g_szNotFound[] = "Not Found"
new const g_szModels[][] = {
"weapon_mp5navy", "Balrog Ethereal", "models/iplay_furien/v_ethereal.mdl", "models/iplay_furien/p_ethereal.mdl", "models/iplay_furien/w_ethereal.mdl", "models/w_mp5.mdl"
}
public plugin_natives()
{
register_library("furien_weapons")
register_native("furien_get_weaponname", "_furien_get_weaponname")
}
public _furien_get_weaponname(szWeapon[])
{
static szName[32]
for(new i = 0; i < sizeof(g_szModels) - 5; i += 6)
{
if(equali(szWeapon, g_szModels[i]))
formatex(szName, charsmax(szName), "%s", g_szModels[i + 1])
}
formatex(szName, charsmax(szName), "%s", g_szNotFound)
return szName
}
The result is this:
http://i.imgur.com/13e4iNk.jpg
I'm using furien_get_weaponname("weapon_mp5navy"). I have no idea how I'm getting the last sound that was played, instead of the weapon's name, which in this case is "Balrog Ethereal".