PHP Code:
public void OnPluginStart()
{
HookEvent("player_death", Event_PlayerDeath);
}
public Action Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(event.GetInt("userid"));
if (IsValidClient(client)) {
SetEntProp(client, Prop_Send, "m_bIsPlayerGhost", true);
}
}
public bool IsValidClient(int client)
{
if (!(1 <= client <= MaxClients) || !IsClientInGame(client) || !IsClientConnected(client) || IsFakeClient(client) || IsClientSourceTV(client))
return false;
return true;
}
Try this, no tested