|
Senior Member
|
08-16-2019
, 20:49
Re: [REQ-L4D2] Kick on Suicide
|
#3
|
better yet kick anyone who dies
Spoiler
PHP Code:
#include <sourcemod>
#pragma semicolon 1
#pragma newdecls required
#define TEAM_SURVIVOR 2
public Plugin myinfo = {
name = "Kick on player death",
author = "",
description = "",
version = "0.0.0",
url = ""
};
public void OnPluginStart()
{
HookEvent("player_death", Event_PlayerDeath, EventHookMode_Pre);
}
public Action Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast)
{
int victim = GetClientOfUserId(event.GetInt("userid"));
if (victim && IsClientInGame(victim) && !IsFakeClient(victim) && GetClientTeam(victim) == TEAM_SURVIVOR)
KickClient(victim, "nab");
return Plugin_Continue;
}
|
|
|
|