Raised This Month: $51 Target: $400
 12% 

Memory leak problem [Solved]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HelpMe
Senior Member
Join Date: Jun 2013
Location: Home
Old 08-28-2013 , 01:40   Memory leak problem [Solved]
Reply With Quote #1

Read the posts for the solution

Timers! timers are annoying I will never figure out how to use them... anyways this time it
I wanted to make a timer that printed a hud telling how many players there is in the server after amount of time (40) but it just print random times please help

Code:
#include <sourcemod>
#include <clients>
#include <morecolors>

//Cvars|Handles
new Handle:h_cvarshowhud;
new Handle:h_cvarcmdenable;
new Players = 0
new Handle:h_HUDTIMER = INVALID_HANDLE;
new Handle:HUDTIMER = INVALID_HANDLE;
new Handle:h_HUDFADEIN;
new Handle:h_HUDFADEOUT;
new Handle:h_HUDHOLDTIME;
new Handle:cvarRed;
new Handle:cvarGreen;
new Handle:cvarBlue;
new Handle:cvarAlpha;
new Handle:cvarhudx;
new Handle:cvarhudy;
new Handle:cvarnumbercolor = INVALID_HANDLE;
new Handle:cvartextcolor = INVALID_HANDLE;
//VARIABLES
new String:g_textcolor[32];
new String:g_numbercolor[32];
new g_Red;
new g_Green;
new g_Blue;
new g_Alpha;
new Float:Hudx;
new Float:Hudy;
new Float:Holdtime;
new Float:Fadein;
new Float:Fadeout;

public Plugin:myinfo = 
{
	name = "ServerPlayers",
	author = "Benjamin",
	description = "How many players there is in server",
	version = "2.0",
	url = "http://steamcommunity.com/id/BenjaminHT/"
}

public OnPluginStart()
{
	cvarnumbercolor = CreateConVar("sm_playes_color", "{green}", "Text color for the number. All colors: https://www.doctormckay.com/morecolors.php", FCVAR_PLUGIN);
	cvartextcolor = CreateConVar("sm_text_color", "{default}", "Text color for the text. All colors: https://www.doctormckay.com/morecolors.php", FCVAR_PLUGIN);
	cvarhudx = CreateConVar("sm_hudx", "0.043", "Hud message x position. -1 = center.", FCVAR_PLUGIN, true, -1.0, true, 1.0);
	cvarhudy = CreateConVar("sm_hudy", "-1.0", "Hud message y position. -1 = center.", FCVAR_PLUGIN, true, -1.0, true, 1.0);
	cvarAlpha = CreateConVar("sm_hudalpha", "100.0", "Alpha.", FCVAR_PLUGIN, true, 0.0, true, 255.0);
	cvarBlue = CreateConVar("sm_hudblue", "20.0", "Color in RGB(Blue).", FCVAR_PLUGIN, true, 0.0, true, 255.0);
	cvarGreen = CreateConVar("sm_hudgreen", "255.0", "Color in RGB(Green).", FCVAR_PLUGIN, true, 0.0, true, 255.0);
	cvarRed = CreateConVar("sm_hudred", "90.0", "Color in RGB(Red).", FCVAR_PLUGIN, true, 0.0, true, 255.0);
	h_HUDFADEOUT = CreateConVar("sm_hud_fadeout_time", "1.0", "How much time it should take to fade out.", FCVAR_PLUGIN, true, 0.1, true, 5.0);
	h_HUDFADEIN = CreateConVar("sm_hud_fadein_time", "1.0", "How much time it should take to fade in.", FCVAR_PLUGIN, true, 0.1, true, 5.0);
	h_HUDHOLDTIME = CreateConVar("sm_hud_hold_time", "4.0", "How Long it should hold the text.", FCVAR_PLUGIN, true, 1.0, true, 30.0);
	h_HUDTIMER = CreateConVar("sm_hudtimer", "40.0", "Timer before it prints to the HUD.", FCVAR_PLUGIN, true, 6.0, true, 290.0);
	h_cvarshowhud = CreateConVar("sm_hud_enable", "1", "1 = Enabled the hud.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
	h_cvarcmdenable = CreateConVar("sm_chat_cmd_enable", "1", "1 = Enabled the chat command.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
	RegConsoleCmd("sm_players", MaxPlayers);
	AutoExecConfig(true, "server_players");
}

//public OnMapStart()
public OnMapEnd()
{
        if(HUDTIMER != INVALID_HANDLE && CloseHandle(HUDTIMER))
		{
            HUDTIMER = INVALID_HANDLE;
		}
}
public OnClientPutInServer(client)
{
	HUDTIMER = CreateTimer(GetConVarFloat(h_HUDTIMER), TimerCallBack, GetClientUserId(client), TIMER_REPEAT);
}

//===============================================================================
//===============================================================================
public Action:TimerCallBack(Handle:timer, any:UserID)
{
	new client = GetClientOfUserId(UserID);
	if(client > 0 && IsClientInGame(client)) {
		Hudx = GetConVarFloat(cvarhudx);
		Hudy = GetConVarFloat(cvarhudy);
		Fadein = GetConVarFloat(h_HUDFADEIN);
		Fadeout = GetConVarFloat(h_HUDFADEOUT);
		Holdtime = GetConVarFloat(h_HUDHOLDTIME);
		g_Red = GetConVarInt(cvarRed);
		g_Green = GetConVarInt(cvarGreen);
		g_Blue = GetConVarInt(cvarBlue);
		g_Alpha = GetConVarInt(cvarAlpha);
	
		new Max = GetMaxClients();
		SetHudTextParams(Hudx, Hudy, Holdtime, g_Red, g_Green, g_Blue, g_Alpha, 0, 6.0, Fadein, Fadeout);
		new ShowHud = GetConVarInt(h_cvarshowhud);
		if(ShowHud == 1)
		{
			ShowHudText(client, -1, "There is [%d/%d] players connected", Players, Max);
		}
	}
}

public OnClientConnected(GetClientUserId)
{
	Players  += 1;
}

public OnClientDisconnect(GetClientUserId)
{
	Players -= 1;
}

public Action:MaxPlayers(client, args)
{
	GetConVarString(cvarnumbercolor, g_numbercolor, sizeof(g_numbercolor));
	GetConVarString(cvartextcolor, g_textcolor, sizeof(g_textcolor));
	new Max = GetMaxClients();
	
	new CMDEnable = GetConVarInt(h_cvarcmdenable);
	if(CMDEnable == 1)
	{
		CReplyToCommand(client, "%sThere is %s[%d/%d]%s players connected", g_textcolor, g_numbercolor, Players, Max, g_textcolor);
	}
}

Last edited by HelpMe; 09-13-2013 at 07:52.
HelpMe is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 08-28-2013 , 09:23   Re: Memory leak problem
Reply With Quote #2

When you create a timer, it creates a handle, if you pass the timer flag TIMER_REPEAT the timer will never end and the handle will stay open forever. You are creating a timer for every player joining, and never killing them.

Don't create a new timer for every new player, use one global timer, where you loop trough all ingame players in the callback. This way you don't have to care about killing the timer when a player leaves.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
HelpMe
Senior Member
Join Date: Jun 2013
Location: Home
Old 08-28-2013 , 10:58   Re: Memory leak problem
Reply With Quote #3

Quote:
Originally Posted by berni View Post
When you create a timer, it creates a handle, if you pass the timer flag TIMER_REPEAT the timer will never end and the handle will stay open forever. You are creating a timer for every player joining, and never killing them.

Don't create a new timer for every new player, use one global timer, where you loop trough all ingame players in the callback. This way you don't have to care about killing the timer when a player leaves.
But how? :I

Last edited by HelpMe; 08-28-2013 at 12:04.
HelpMe is offline
Marcus101RR
Veteran Member
Join Date: Aug 2009
Location: Tampa, FL
Old 08-28-2013 , 12:19   Re: Memory leak problem
Reply With Quote #4

Changelog:
- Changed to OnClientPostAdminCheck(client)

PHP Code:
#include <sourcemod>
#include <clients>
#include <morecolors>

//Cvars|Handles
new Handle:h_cvarshowhud;
new 
Handle:h_cvarcmdenable;
new 
Players 0
new Handle:h_HUDTIMER INVALID_HANDLE;
new 
Handle:HUDTIMER[MAXPLAYERS 1] = INVALID_HANDLE;
new 
Handle:h_HUDFADEIN;
new 
Handle:h_HUDFADEOUT;
new 
Handle:h_HUDHOLDTIME;
new 
Handle:cvarRed;
new 
Handle:cvarGreen;
new 
Handle:cvarBlue;
new 
Handle:cvarAlpha;
new 
Handle:cvarhudx;
new 
Handle:cvarhudy;
new 
Handle:cvarnumbercolor INVALID_HANDLE;
new 
Handle:cvartextcolor INVALID_HANDLE;
//VARIABLES
new String:g_textcolor[32];
new 
String:g_numbercolor[32];
new 
g_Red;
new 
g_Green;
new 
g_Blue;
new 
g_Alpha;
new 
Float:Hudx;
new 
Float:Hudy;
new 
Float:Holdtime;
new 
Float:Fadein;
new 
Float:Fadeout;

public 
Plugin:myinfo 
{
    
name "ServerPlayers",
    
author "Benjamin",
    
description "How many players there is in server",
    
version "2.0",
    
url "http://steamcommunity.com/id/BenjaminHT/"
}

public 
OnPluginStart()
{
    
cvarnumbercolor CreateConVar("sm_playes_color""{green}""Text color for the number. All colors: https://www.doctormckay.com/morecolors.php"FCVAR_PLUGIN);
    
cvartextcolor CreateConVar("sm_text_color""{default}""Text color for the text. All colors: https://www.doctormckay.com/morecolors.php"FCVAR_PLUGIN);
    
cvarhudx CreateConVar("sm_hudx""0.043""Hud message x position. -1 = center."FCVAR_PLUGINtrue, -1.0true1.0);
    
cvarhudy CreateConVar("sm_hudy""-1.0""Hud message y position. -1 = center."FCVAR_PLUGINtrue, -1.0true1.0);
    
cvarAlpha CreateConVar("sm_hudalpha""100.0""Alpha."FCVAR_PLUGINtrue0.0true255.0);
    
cvarBlue CreateConVar("sm_hudblue""20.0""Color in RGB(Blue)."FCVAR_PLUGINtrue0.0true255.0);
    
cvarGreen CreateConVar("sm_hudgreen""255.0""Color in RGB(Green)."FCVAR_PLUGINtrue0.0true255.0);
    
cvarRed CreateConVar("sm_hudred""90.0""Color in RGB(Red)."FCVAR_PLUGINtrue0.0true255.0);
    
h_HUDFADEOUT CreateConVar("sm_hud_fadeout_time""1.0""How much time it should take to fade out."FCVAR_PLUGINtrue0.1true5.0);
    
h_HUDFADEIN CreateConVar("sm_hud_fadein_time""1.0""How much time it should take to fade in."FCVAR_PLUGINtrue0.1true5.0);
    
h_HUDHOLDTIME CreateConVar("sm_hud_hold_time""4.0""How Long it should hold the text."FCVAR_PLUGINtrue1.0true30.0);
    
h_HUDTIMER CreateConVar("sm_hudtimer""40.0""Timer before it prints to the HUD."FCVAR_PLUGINtrue6.0true290.0);
    
h_cvarshowhud CreateConVar("sm_hud_enable""1""1 = Enabled the hud."FCVAR_PLUGINtrue0.0true1.0);
    
h_cvarcmdenable CreateConVar("sm_chat_cmd_enable""1""1 = Enabled the chat command."FCVAR_PLUGINtrue0.0true1.0);
    
RegConsoleCmd("sm_players"MaxPlayers);
    
AutoExecConfig(true"server_players");
}

//public OnMapStart()
public OnMapEnd()
{
    for(new 
1<= MaxClientsi++)
    {
        if(
HUDTIMER[i] != INVALID_HANDLE)
        {
            
CloseHandle(HUDTIMER[i]);
            
HUDTIMER[i] = INVALID_HANDLE;
        }
    }
}
public 
OnClientPostAdminCheck(client)
{
    
HUDTIMER[client] = CreateTimer(GetConVarFloat(h_HUDTIMER), TimerCallBackclientTIMER_REPEAT);
}

//===============================================================================
//===============================================================================
public Action:TimerCallBack(Handle:timerany:UserID)
{
    new 
client GetClientOfUserId(UserID);
    if(
client && IsClientInGame(client)) {
        
Hudx GetConVarFloat(cvarhudx);
        
Hudy GetConVarFloat(cvarhudy);
        
Fadein GetConVarFloat(h_HUDFADEIN);
        
Fadeout GetConVarFloat(h_HUDFADEOUT);
        
Holdtime GetConVarFloat(h_HUDHOLDTIME);
        
g_Red GetConVarInt(cvarRed);
        
g_Green GetConVarInt(cvarGreen);
        
g_Blue GetConVarInt(cvarBlue);
        
g_Alpha GetConVarInt(cvarAlpha);
    
        new 
Max GetMaxClients();
        
SetHudTextParams(HudxHudyHoldtimeg_Redg_Greeng_Blueg_Alpha06.0FadeinFadeout);
        new 
ShowHud GetConVarInt(h_cvarshowhud);
        if(
ShowHud == 1)
        {
            
ShowHudText(client, -1"There is [%d/%d] players connected"PlayersMax);
        }
    }
}

public 
OnClientConnected(client)
{
    
Players  += 1;
}

public 
OnClientDisconnect(client)
{
    
Players -= 1;
    
CloseHandle(HUDTIMER[client]);
    
HUDTIMER[client] = INVALID_HANDLE;
}

public 
Action:MaxPlayers(clientargs)
{
    
GetConVarString(cvarnumbercolorg_numbercolorsizeof(g_numbercolor));
    
GetConVarString(cvartextcolorg_textcolorsizeof(g_textcolor));
    new 
Max GetMaxClients();
    
    new 
CMDEnable GetConVarInt(h_cvarcmdenable);
    if(
CMDEnable == 1)
    {
        
CReplyToCommand(client"%sThere is %s[%d/%d]%s players connected"g_textcolorg_numbercolorPlayersMaxg_textcolor);
    }

__________________

Last edited by Marcus101RR; 08-28-2013 at 15:32. Reason: Fixed
Marcus101RR is offline
Send a message via AIM to Marcus101RR Send a message via Skype™ to Marcus101RR
HelpMe
Senior Member
Join Date: Jun 2013
Location: Home
Old 08-28-2013 , 13:01   Re: Memory leak problem
Reply With Quote #5

Quote:
Originally Posted by Marcus101RR View Post
PHP Code:
#include <sourcemod>
#include <clients>
#include <morecolors>

//Cvars|Handles
new Handle:h_cvarshowhud;
new 
Handle:h_cvarcmdenable;
new 
Players 0
new Handle:h_HUDTIMER INVALID_HANDLE;
new 
Handle:HUDTIMER[MAXPLAYERS 1] = INVALID_HANDLE;
new 
Handle:h_HUDFADEIN;
new 
Handle:h_HUDFADEOUT;
new 
Handle:h_HUDHOLDTIME;
new 
Handle:cvarRed;
new 
Handle:cvarGreen;
new 
Handle:cvarBlue;
new 
Handle:cvarAlpha;
new 
Handle:cvarhudx;
new 
Handle:cvarhudy;
new 
Handle:cvarnumbercolor INVALID_HANDLE;
new 
Handle:cvartextcolor INVALID_HANDLE;
//VARIABLES
new String:g_textcolor[32];
new 
String:g_numbercolor[32];
new 
g_Red;
new 
g_Green;
new 
g_Blue;
new 
g_Alpha;
new 
Float:Hudx;
new 
Float:Hudy;
new 
Float:Holdtime;
new 
Float:Fadein;
new 
Float:Fadeout;

public 
Plugin:myinfo 
{
    
name "ServerPlayers",
    
author "Benjamin",
    
description "How many players there is in server",
    
version "2.0",
    
url "http://steamcommunity.com/id/BenjaminHT/"
}

public 
OnPluginStart()
{
    
cvarnumbercolor CreateConVar("sm_playes_color""{green}""Text color for the number. All colors: https://www.doctormckay.com/morecolors.php"FCVAR_PLUGIN);
    
cvartextcolor CreateConVar("sm_text_color""{default}""Text color for the text. All colors: https://www.doctormckay.com/morecolors.php"FCVAR_PLUGIN);
    
cvarhudx CreateConVar("sm_hudx""0.043""Hud message x position. -1 = center."FCVAR_PLUGINtrue, -1.0true1.0);
    
cvarhudy CreateConVar("sm_hudy""-1.0""Hud message y position. -1 = center."FCVAR_PLUGINtrue, -1.0true1.0);
    
cvarAlpha CreateConVar("sm_hudalpha""100.0""Alpha."FCVAR_PLUGINtrue0.0true255.0);
    
cvarBlue CreateConVar("sm_hudblue""20.0""Color in RGB(Blue)."FCVAR_PLUGINtrue0.0true255.0);
    
cvarGreen CreateConVar("sm_hudgreen""255.0""Color in RGB(Green)."FCVAR_PLUGINtrue0.0true255.0);
    
cvarRed CreateConVar("sm_hudred""90.0""Color in RGB(Red)."FCVAR_PLUGINtrue0.0true255.0);
    
h_HUDFADEOUT CreateConVar("sm_hud_fadeout_time""1.0""How much time it should take to fade out."FCVAR_PLUGINtrue0.1true5.0);
    
h_HUDFADEIN CreateConVar("sm_hud_fadein_time""1.0""How much time it should take to fade in."FCVAR_PLUGINtrue0.1true5.0);
    
h_HUDHOLDTIME CreateConVar("sm_hud_hold_time""4.0""How Long it should hold the text."FCVAR_PLUGINtrue1.0true30.0);
    
h_HUDTIMER CreateConVar("sm_hudtimer""40.0""Timer before it prints to the HUD."FCVAR_PLUGINtrue6.0true290.0);
    
h_cvarshowhud CreateConVar("sm_hud_enable""1""1 = Enabled the hud."FCVAR_PLUGINtrue0.0true1.0);
    
h_cvarcmdenable CreateConVar("sm_chat_cmd_enable""1""1 = Enabled the chat command."FCVAR_PLUGINtrue0.0true1.0);
    
RegConsoleCmd("sm_players"MaxPlayers);
    
AutoExecConfig(true"server_players");
}

//public OnMapStart()
public OnMapEnd()
{
    for(new 
1<= MaxClientsi++)
    {
        if(
HUDTIMER[i] != INVALID_HANDLE)
        {
            
CloseHandle(HUDTIMER[i]);
            
HUDTIMER[i] = INVALID_HANDLE;
        }
    }
}
public 
OnClientPutInServer(client)
{
    
HUDTIMER[client] = CreateTimer(GetConVarFloat(h_HUDTIMER), TimerCallBackclientTIMER_REPEAT);
}

//===============================================================================
//===============================================================================
public Action:TimerCallBack(Handle:timerany:UserID)
{
    new 
client GetClientOfUserId(UserID);
    if(
client && IsClientInGame(client)) {
        
Hudx GetConVarFloat(cvarhudx);
        
Hudy GetConVarFloat(cvarhudy);
        
Fadein GetConVarFloat(h_HUDFADEIN);
        
Fadeout GetConVarFloat(h_HUDFADEOUT);
        
Holdtime GetConVarFloat(h_HUDHOLDTIME);
        
g_Red GetConVarInt(cvarRed);
        
g_Green GetConVarInt(cvarGreen);
        
g_Blue GetConVarInt(cvarBlue);
        
g_Alpha GetConVarInt(cvarAlpha);
    
        new 
Max GetMaxClients();
        
SetHudTextParams(HudxHudyHoldtimeg_Redg_Greeng_Blueg_Alpha06.0FadeinFadeout);
        new 
ShowHud GetConVarInt(h_cvarshowhud);
        if(
ShowHud == 1)
        {
            
ShowHudText(client, -1"There is [%d/%d] players connected"PlayersMax);
        }
    }
}

public 
OnClientConnected(client)
{
    
Players  += 1;
}

public 
OnClientDisconnect(client)
{
    
Players -= 1;
    
CloseHandle(HUDTIMER[client]);
    
HUDTIMER[client] = INVALID_HANDLE;
}

public 
Action:MaxPlayers(clientargs)
{
    
GetConVarString(cvarnumbercolorg_numbercolorsizeof(g_numbercolor));
    
GetConVarString(cvartextcolorg_textcolorsizeof(g_textcolor));
    new 
Max GetMaxClients();
    
    new 
CMDEnable GetConVarInt(h_cvarcmdenable);
    if(
CMDEnable == 1)
    {
        
CReplyToCommand(client"%sThere is %s[%d/%d]%s players connected"g_textcolorg_numbercolorPlayersMaxg_textcolor);
    }

With that it doesn't print at all :c
HelpMe is offline
Marcus101RR
Veteran Member
Join Date: Aug 2009
Location: Tampa, FL
Old 08-28-2013 , 15:33   Re: Memory leak problem
Reply With Quote #6

I changed the on client connect situation for it to start to OnClientPostAdminCheck

See if that solves the problem, also post any error logs you have related to this plugin so I can debug the issue.
__________________
Marcus101RR is offline
Send a message via AIM to Marcus101RR Send a message via Skype™ to Marcus101RR
HelpMe
Senior Member
Join Date: Jun 2013
Location: Home
Old 08-28-2013 , 15:42   Re: Memory leak problem
Reply With Quote #7

Quote:
Originally Posted by Marcus101RR View Post
I changed the on client connect situation for it to start to OnClientPostAdminCheck

See if that solves the problem, also post any error logs you have related to this plugin so I can debug the issue.
No errors but it just don't print the HUD
HelpMe is offline
Chaosxk
Veteran Member
Join Date: Aug 2010
Location: Westeros
Old 08-28-2013 , 17:29   Re: Memory leak problem
Reply With Quote #8

You forgot to create a HUD Handle, it should look something like this.

PHP Code:
public Action:TimerCallBack(Handle:timerany:UserID

    new 
client GetClientOfUserId(UserID); 
    if(
client && IsClientInGame(client)) { 
        
Hudx GetConVarFloat(cvarhudx); 
        
Hudy GetConVarFloat(cvarhudy); 
        
Fadein GetConVarFloat(h_HUDFADEIN); 
        
Fadeout GetConVarFloat(h_HUDFADEOUT); 
        
Holdtime GetConVarFloat(h_HUDHOLDTIME); 
        
g_Red GetConVarInt(cvarRed); 
        
g_Green GetConVarInt(cvarGreen); 
        
g_Blue GetConVarInt(cvarBlue); 
        
g_Alpha GetConVarInt(cvarAlpha); 
     
        new 
Max GetMaxClients(); 
        new 
Handle:hudText CreateHudSynchronizer();
        
SetHudTextParams(HudxHudyHoldtimeg_Redg_Greeng_Blueg_Alpha06.0FadeinFadeout); 
        new 
ShowHud GetConVarInt(h_cvarshowhud); 
        if(
ShowHud == 1
        { 
            
ShowSyncHudText(clienthudText"There is [%d/%d] players connected"PlayersMax);
        } 
    } 

Just replace this timer callback with the code Marcus101RR posted as he fixed a few other issues.
__________________

Last edited by Chaosxk; 08-28-2013 at 17:31.
Chaosxk is offline
Marcus_Brown001
AlliedModders Donor
Join Date: Nov 2012
Location: Illinois, United States
Old 08-28-2013 , 17:48   Re: Memory leak problem
Reply With Quote #9

Please keep in mind that this will not change any functionality inside your plugin! I just wanted to show you an easier / optimized way to do your hud color convars. Good luck with your plugin, hope this helps in some way!

Click Me!
Marcus_Brown001 is offline
HelpMe
Senior Member
Join Date: Jun 2013
Location: Home
Old 08-29-2013 , 08:38   Re: Memory leak problem
Reply With Quote #10

Found teh problem. By deleting this from Marcus's part it worked.
I don't know if it was very important to have that in the code tell me if it was


Code:
	new client = GetClientOfUserId(client); 
	if(client > 0 && IsClientInGame(UserID))
	{
	}

Code:
public Action:TimerCallBack(Handle:timer, any:UserID)
{
	//new client = GetClientOfUserId(client); 
	//if(client > 0 && IsClientInGame(UserID))
	//{
	Hudx = GetConVarFloat(cvarhudx); 
	Hudy = GetConVarFloat(cvarhudy); 
	Fadein = GetConVarFloat(h_HUDFADEIN); 
	Fadeout = GetConVarFloat(h_HUDFADEOUT); 
	Holdtime = GetConVarFloat(h_HUDHOLDTIME); 
	g_Red = GetConVarInt(cvarRed); 
	g_Green = GetConVarInt(cvarGreen); 
	g_Blue = GetConVarInt(cvarBlue); 
	g_Alpha = GetConVarInt(cvarAlpha); 
	new Max = GetMaxClients(); 
	new Handle:hudText = CreateHudSynchronizer();
	SetHudTextParams(Hudx, Hudy, Holdtime, g_Red, g_Green, g_Blue, g_Alpha, 0, 6.0, Fadein, Fadeout); 
	new ShowHud = GetConVarInt(h_cvarshowhud);
	if(ShowHud == 1)
	{
		ShowSyncHudText(UserID, hudText, "There is [%d/%d] players connected", Players, Max);
	}
	//}
}
HelpMe is offline
Reply



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 22:46.


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