Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdktools>
- #pragma newdecls required
- #pragma semicolon 1
- public void OnPluginStart()
- {
- HookEvent("player_hurt", iHurt);
- }
- public Action iHurt(Handle event, const char[] name, bool dontBroadcast)
- {
- int client = GetClientOfUserId(GetEventInt(event, "attacker"));
- int victim = GetClientOfUserId(GetEventInt(event, "userid"));
- if(bIsSurvivor(client) && bIsSurvivor(victim))
- {
- int hitgroup = GetClientOfUserId(GetEventInt(event, "hitgroup"));
- if(hitgroup == 1)
- {
- ForcePlayerSuicide(victim);
- }
- }
- }
- stock bool bIsSurvivor(int client)
- {
- return client > 0 && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 2 && !IsClientInKickQueue(client) && IsPlayerAlive(client);
- }
Advertisement
Add Comment
Please, Sign In to add comment