AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   General (https://forums.alliedmods.net/forumdisplay.php?f=58)
-   -   Solved GetClientTeam error (https://forums.alliedmods.net/showthread.php?t=326238)

r4f4w 07-24-2020 00:35

GetClientTeam error
 
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(clientSDKHook_OnTakeDamageOnDamage);

}

public 
Action:OnDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
    if(!
attacker)
        return 
Plugin_Continue;

    if(
inflictor && inflictor <= MaxClients)
    {

        new 
String:Weapon[32];
    
        new 
weapon GetEntPropEnt(inflictorProp_Send"m_hActiveWeapon");
        
GetEdictClassname(weaponWeapon32);
    
        if(
StrContains(Weapon"knife") == -&& 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)

r4f4w 07-24-2020 10:31

Re: GetClientTeam error
 
Just updated the sourcemod and fixed everthing!

thekings4fun 07-25-2020 11:07

Re: GetClientTeam error
 
Quote:

Originally Posted by r4f4w (Post 2711481)
Just updated the sourcemod and fixed everthing!


here for me on my server it didn't work, I need something that will leave the damage only with molotov and grenade.


All times are GMT -4. The time now is 02:34.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.