If anyone wanna know i found the way, the code example i use for testing is:
Code:
#pragma semicolon 1
#include <sourcemod>
public OnPluginStart()
{
HookEvent("player_hurt", test);
}
public Action:test(Handle:event, const String:name[], bool dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
CreateTimer(0.0, lmao, client);
}
public Action:lmao(Handle:timer, any:client)
{
if (client == 0)
{
return Plugin_Continue;
}
if (IsPlayerAlive(client))
{
FakeClientCommandEx(client, "kill");
}
return Plugin_Handled;
}
keep in mind this may spew out some invalid client index errors at some points
__________________