View Single Post
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 07-10-2018 , 07:57   Re: CS:GO Plugin Modify (1 kill + 5hp)
Reply With Quote #2

you can used this thraed:
https://forums.alliedmods.net/showthread.php?t=307697
or
PHP Code:
#include <sourcemod> 
#pragma semicolon 1 
#pragma newdecls required 
#define HP_VERSION "1.0" 

public Plugin myinfo 

     
name "1 Kill/+5 HP for Admins"
     
author "Psyk0tik (Crasher_3637), MonsteQ, sidezz"
     
description "Gives +5 HP per kill for admins."
     
version HP_VERSION
     
url "https://forums.alliedmods.net/showthread.php?t=307697" 
}; 

ConVar g_cvHPEnable
ConVar g_cvHPAdmin;

public 
void OnPluginStart() 

     
g_cvHPEnable CreateConVar("hp_enable""1""Enable plugin?\n(0: OFF)\n(1: ON)"); 
     
g_cvHPAdmin CreateConVar("hp_admin""0""Enable plugin only for Admin?\n(0: OFF)\n(1: ON)"); 
     
CreateConVar("hp_version"HP_VERSION"Plugin version."FCVAR_NOTIFY|FCVAR_DONTRECORD); 
     
HookEvent("player_death"ePlayerDeath); 
     
AutoExecConfig(true"hp_kills_for_admins"); 


public 
Action ePlayerDeath(Event event, const char[] namebool dontBroadcast)   
{
    if (!
g_cvHPEnable.BoolValue)
    {
        return 
Plugin_Handled;
    }
    
int iAttacker GetClientOfUserId(event.GetInt("attacker"));
    
int iVictim GetClientOfUserId(event.GetInt("userid"));
    if ((!
g_cvHPAdmin.BoolValue || (g_cvHPAdmin.BoolValue && IsAdminAllowed(iAttacker))) && IsValidClient(iAttacker) && iAttacker != iVictim)
    {
        
SetEntityHealth(iAttackerGetClientHealth(iAttacker) + 5);
    }
    return 
Plugin_Continue;   
}  

stock bool IsValidClient(int client

     return (
client && client <= MaxClients && IsClientInGame(client) && !IsClientInKickQueue(client) && IsPlayerAlive(client)); 


stock bool IsAdminAllowed(int client

     return (
CheckCommandAccess(client"hp_override"ADMFLAG_CUSTOM6false)); 

Dr.Mohammad is offline