Raised This Month: $275 Target: $400
 68% 

[CSGO] random HP at round start


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nguyenbaodanh
AlliedModders Donor
Join Date: Jun 2007
Location: HCMC, Vietnam
Old 06-13-2018 , 22:47   [CSGO] random HP at round start
Reply With Quote #1

Hi!
I need a plugin just for fun, the plugin that will set players HP randomly at every round start in a range to be set in config
example:
sm_randomhp_min "1"
sm_randomhp_max "99"

Thanks guys ! <3
__________________
nguyenbaodanh is offline
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));        

__________________


Currently accepting private requests.
LenHard is offline
nguyenbaodanh
AlliedModders Donor
Join Date: Jun 2007
Location: HCMC, Vietnam
Old 06-14-2018 , 00:23   Re: [CSGO] random HP at round start
Reply With Quote #3

Tested . works like charm .
Thanks so much LenHard
__________________
nguyenbaodanh is offline
Reply


Thread Tools
Display Modes

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 11:42.


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