can someone help me with this?
this plugin i using for disable knife damage for teammate but when i try to changed the "knife" to "taser" the taser damage still enable
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <cstrike>
public Plugin:myinfo = {
name = "Block Friendly Knife",
author = "The Count",
description = "Blocks knife damage if on friendly player.",
version = "1",
url = ""
}
public OnPluginStart(){
HookEvent("player_hurt", Event_PlayerHurt, EventHookMode_Pre);
}
public Action:Event_PlayerHurt (Handle:event, const String:name[], bool:dontBroadcast){
new String:wep[20];
new victim = GetClientOfUserId(GetEventInt(event, "userid"));
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
GetEventString(event, "weapon", wep, sizeof(wep));
if(strcmp(wep, "knife", false)==0){
if(GetClientTeam(victim) == GetClientTeam(attacker)){
SetEventInt(event, "dmg_health", 0);
SetEventInt(event, "dmg_armor", 0);
return Plugin_Changed;
}
}
return Plugin_Continue;
}