Hi, I've made a plugin "Be Robin Walker" but there is a problem : I can't get the owner of the powerful weapon, here is my code :
PHP Code:
public void OnEntityCreated(int entity, const char[] classname)
{
if(StrEqual(classname, "tf_dropped_weapon", false))
{
SDKHook(entity, SDKHook_SpawnPost, DroppedWeaponSpawn);
}
}
public void DroppedWeaponSpawn(int iEntity)
{
for(int i = 0; i <= MaxClients; i++)
{
if(IsValidClient(i))
{
if(bIsRobin[i])
{
PrintToChat(i, "Client Account id :%d || Owner account id : %i", GetSteamAccountID(i), GetEntProp(iEntity, Prop_Send, "m_iAccountID"));
if(GetEntProp(iEntity, Prop_Send, "m_iAccountID") == GetSteamAccountID(i))
{
AcceptEntityInput(iEntity, "Kill");
}
}
}
}
}
result :
Code:
"Client Account id : 123456789 || Owner account id : 0
__________________