AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [CSGO] random HP at round start (https://forums.alliedmods.net/showthread.php?t=308276)

nguyenbaodanh 06-13-2018 22:47

[CSGO] random HP at round start
 
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

LenHard 06-13-2018 23:05

Re: [CSGO] random HP at round start
 
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));        



nguyenbaodanh 06-14-2018 00:23

Re: [CSGO] random HP at round start
 
Tested . works like charm .
Thanks so much LenHard


All times are GMT -4. The time now is 08:26.

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