View Single Post
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 07-23-2018 , 17:43   Re: CS:GO Player Health by 200 HP = round end
Reply With Quote #5

Still needs some modifications but it should be a good start:

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

#pragma semicolon 1
#pragma newdecls  required

public void OnMapStart() 

    
HookEvent("player_death"OnPlayerDeathPost); 


public 
void OnPlayerDeathPost(Event hEvent, const char[] szNamebool bDontBroadcast)
{
    
int iAttacker GetClientOfUserId(hEvent.GetInt("attacker"));
    
    if (
IsClientInGame(iAttacker) && IsPlayerAlive(iAttacker))
    {
        
int iHealth GetClientHealth(iAttacker) + 5;
        
        if (
iHealth >= 200)
        {
            
// Optional
            
SetEntityHealth(iAttacker200);
            
            
PrintToChatAll("Player %N won the round !"iAttacker);
            
            
CS_TerminateRound(3.0CSRoundEnd_Draw);
        }
        else
        {
            
SetEntityHealth(iAttackeriHealth);
        }
    }

__________________
micapat is offline