Hy all! I have a problem about this...after behind my team get me respawn...I want to get respawn after behind other team example :
terrorist behind terrorist = no respawn
counter terrorist behind counter terrorist = no respawn
terrorist behind counter terrorist = respawn
counter terrorist behind terrorist = respawn
Code:
#include <sourcemod>
#include <sdkhooks>
#include <cstrike>
public OnClientPutInServer(client){
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}
public OnClientDisconnect(client){
SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}
public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype){
if(victim <= 0 && victim > MaxClients){ return Plugin_Continue; }
if(attacker <= 0 || attacker > MaxClients){ return Plugin_Continue; }
if(damage > 66.0){
new String:wep[64];GetClientWeapon(attacker, wep, sizeof(wep));
if(StrEqual(wep, "weapon_knife", false)){
PrintToChat(attacker, "\x01[SM]\x04 Backstab detected!");
ClientCommand(attacker, "play *weapons/awp/awp1.wav");
damage = 0.0;
CS_RespawnPlayer(attacker);
return Plugin_Changed;
}
}
return Plugin_Continue;
}