View Single Post
LenHard
Senior Member
Join Date: Jan 2016
Old 06-13-2018 , 23:05   Re: [CSGO] random HP at round start
Reply With Quote #2

PHP Code:
#include <sourcemod>

#pragma semicolon 1
#pragma newdecls required

ConVar gCV_HP_Min;
ConVar gCV_HP_Max;

public 
void OnPluginStart()
{
    
gCV_HP_Min CreateConVar("sm_randomhp_min""1""Least amount of possible health."FCVAR_NOTIFYtrue1.0);
    
gCV_HP_Max CreateConVar("sm_randomhp_max""99""Maximum amount of possible health."FCVAR_NOTIFYtrue2.0);
    
AutoExecConfig(true"randomhp.cfg");
    
    
HookEvent("round_start"Event_RoundStartEventHookMode_Post);    
}

public 
void Event_RoundStart(Event hEvent, const char[] sEventNamebool bDontBroadcast)
{
    for (
int i 1<= MaxClients; ++i)
        if (
IsClientInGame(i)) 
            
SetEntityHealth(iGetRandomInt(gCV_HP_Min.IntValuegCV_HP_Max.IntValue));        

__________________
LenHard is offline