For some reason while in Ham_Killed i get issues with Cstrike natives (cs_get_weapon_id()) Also tried multiple other cs natives all gave the same error
I used get_user_name to display the name of the killer and it returns my name so not sure why im having issues with cstrike natives saying im not a player lol.
Code:
L 07/29/2011 - 00:07:31: [CSTRIKE] Non-player entity 1 out of range
L 07/29/2011 - 00:07:31: [AMXX] Run time error 10: native error (native "cs_get_weapon_id")
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
new bool:gBotsRegistered;
public plugin_init()
{
RegisterHam(Ham_Killed, "player", "fwdPlayerDeath");
}
public fwdPlayerDeath(iVictim, iKiller, iShouldGib)
{
if(!is_user_alive(iKiller))
return HAM_IGNORED;
if(get_user_team(iVictim) == get_user_team(iKiller))
return HAM_IGNORED;
//This gives error posted in thread
new WeaponID = cs_get_weapon_id(iKiller);//<----Error line
//This works fine
//new WeaponID = get_user_weapon(iKiller);
client_print(0, print_chat, "ID: %d ..... WeaponID: %d", iKiller, WeaponID);
return HAM_HANDLED;
}