Guys, i currently have this code in this plugin that blocks knife and zeus attack from teammates only:
PHP Code:
#include <sourcemod>
#include <sdkhooks>
new Handle:facaAmigo;
new Handle:zeusAmigo;
public OnPluginStart()
{
facaAmigo = CreateConVar("block_knife_teamattack", "1", "Enables or disable");
zeusAmigo = CreateConVar("block_zeus_teamattack", "1", "Enables or disable");
}
public OnClientPutInServer(client)
{
SDKHook(client, SDKHook_OnTakeDamage, OnDamage);
}
public Action:OnDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
if(!attacker)
return Plugin_Continue;
if(inflictor > 0 && inflictor <= MaxClients)
{
new String:Weapon[32];
new weapon = GetEntPropEnt(inflictor, Prop_Send, "m_hActiveWeapon");
GetEdictClassname(weapon, Weapon, 32);
if(StrContains(Weapon, "knife") == -1 && StrContains(Weapon, "taser") == -1){
return Plugin_Continue;
}
if (GetClientTeam(victim) == GetClientTeam(attacker) && GetConVarBool(facaAmigo)) {
PrintToChatAll("test");
return Plugin_Handled;
}
if (GetClientTeam(victim) == GetClientTeam(attacker) && GetConVarBool(zeusAmigo)) {
PrintToChatAll("test2");
return Plugin_Handled;
}
}
return Plugin_Continue;
}
After this update, i think the
GetClientTeam() function is
not working anymore.
I tried to put
PrintToChatAll("test") to see if the IF condition was working, and didn't print.
I also tried to print the index in the chat, to see what is going on (i used
IntToString() and then
PrintToChatAll()), but nothing was displayed on chat.
This plugin was working until today's update (1.37.6.0)