Raised This Month: $32 Target: $400
 8% 

CS:GO No Knife damage on command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nocky
Member
Join Date: Oct 2013
Location: Czech Republic
Old 02-19-2019 , 17:56   CS:GO No Knife damage on command
Reply With Quote #1

Hi, I would like someone to ask if he could modify this plugin.
To cvar block_knife_enemy, go to /knifeon and /knifeoff, and go only to players with flag:
Custom flag "p"
and cvar block_knife_teamattack only for flag root without /command

Thanks

PHP Code:
#include <sourcemod>
#include <sdkhooks>

new Handle:amigo;
new 
Handle:enemigo;

public 
OnPluginStart()
{
    
amigo CreateConVar("block_knife_teamattack""1""Enables or disable");
    
enemigo CreateConVar("block_knife_enemy""1""Enable or disable");
}

public 
OnClientPutInServer(client)
{
   
SDKHook(clientSDKHook_OnTakeDamageOnDamage);

}

//public Action:OnDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
public Action:OnDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype, &weaponFloat:damageForce[3], Float:damagePosition[3]) 
{
    
//if (!attacker)
    
if(attacker || attacker MaxClients || victim || victim MaxClients)
        return 
Plugin_Continue;

    if (!
IsValidEdict(weapon))
        return 
Plugin_Continue;

    
//new String:Weapon[32];
    
decl String:Weapon[32];
    
    
//new weapon = GetEntPropEnt(inflictor, Prop_Send, "m_hActiveWeapon");
    
GetEdictClassname(weaponWeapon32);
    
    if(
StrContains(Weapon"knife") == -1)
        return 
Plugin_Continue;


    if (
GetClientTeam(victim) == GetClientTeam(attacker) && GetConVarBool(amigo)) return Plugin_Handled;
    else if (
GetClientTeam(victim) != GetClientTeam(attacker) && GetConVarBool(enemigo)) return Plugin_Handled;

    return 
Plugin_Continue;


Last edited by Nocky; 02-19-2019 at 17:56.
Nocky is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:49.


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