Soumyadip Dutta
Пользователь
- Регистрация
- 5 Сен 2017
- Сообщения
- 8
- Симпатии
- 0
- Предупреждения
- 30
- Пол
- Мужской
I want to know how we can get know about killer weapon name and check in any if else condition help me please
#include <amxmodx>
#include <reapi>
public plugin_init()
{
RegisterHookChain(RG_CSGameRules_DeathNotice, "CSGameRules_DeathNotice", .post = true)
}
public CSGameRules_DeathNotice(const pVictim, const pKiller, pInflictor)
{
if (pVictim == pKiller || !is_user_connected(pKiller))
{
return HC_CONTINUE
}
new szWeaponName[32]
if (pKiller == pInflictor)
{
pInflictor = get_member(pKiller, m_pActiveItem)
}
if (is_nullent(pInflictor))
{
return HC_CONTINUE
}
get_entvar(pInflictor, var_classname, szWeaponName, charsmax(szWeaponName))
if (szWeaponName[0] == 'g' && szWeaponName[6] == 'e') // grenade
{
server_print("WEAPON: %s | WEAPON ID: %d | HEADSHOT: NO", szWeaponName, WEAPON_HEGRENADE)
}
else
{
server_print("WEAPON: %s | WEAPON ID: %d | HEADSHOT: %s",
szWeaponName[7], get_member(pInflictor, m_iId), get_member(pVictim, m_bHeadshotKilled) ? "YES" : "NO")
}
return HC_CONTINUE
}