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

modify the output message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jonny1990
Senior Member
Join Date: Apr 2020
Old 05-04-2020 , 12:51   modify the output message
Reply With Quote #1

Hello, how do I change the output of a chat message in hud? and that would message showed constantly, and saw his only the dead and observers
Code:
#include < amxmodx > 
#include < nvault >

new hNvault, connects, gMax, connect[33];//, Float: gTime;

#define TASK 		92512
#define TIME_TASK	92513

#define TIME 		600.0	

public plugin_init(){
	register_plugin("InfoConnects", "1.0", "PAffAEJIkA :3");
	nvOpen();	
	
	connects = nvault_get(hNvault, "CONNECTS");
	
	new szDate[16], szData[16];	get_time("%H:%M", szDate, charsmax(szDate));
	strtok(szDate, szDate, charsmax(szDate), szData, charsmax(szData), ':');
	if(str_to_num(szDate) == 23){
		new szTime = (60 - str_to_num(szData)) * 60;	
		set_task(float(szTime), "changeVault", TASK);
	}
	
	gMax = get_maxplayers();
	set_task(TIME, "pchat", TIME_TASK, .flags = "b");
	//register_logevent("round_start", 2, "1=Round_Start");
}

public client_putinserver(id){
	if(is_user_bot(id) || is_user_hltv(id))	
		return;
	
	new szSteam[35];	
	get_user_authid(id, szSteam, charsmax(szSteam));
	connect[id] = nvault_get(hNvault, szSteam);
	
	if(!connect[id]){
		connects ++;
		
		new string[8];	
		formatex(string, charsmax(string), "%d", connects);
		nvault_set(hNvault, "CONNECTS", string);
		
		nvault_set(hNvault, szSteam, "1");
	}
}

public pchat()
	client_print_color(0, 0, "^1[^4info^1]  text massage^4 %d!", get_playersnum(), gMax, connects);

/*public round_start(){
	if(gTime > get_gametime())
		return;
	
	gTime = get_gametime() + TIME;
	client_print_color(0, 0, "^1[^4info^1]  text massage^4 %d!", get_playersnum(), gMax, connects);
}*/

public nvOpen(){
	new szDate[3];	
	get_time("%d", szDate, charsmax(szDate));
	
	new szVName[64];	
	formatex(szVName, charsmax(szVName), "CONNECTS%d", str_to_num(szDate));
	
	hNvault = nvault_open(szVName);
	if(hNvault == INVALID_HANDLE)	
		set_fail_state("Fail open NVAULT file!");
	
	new szFile[128];	
	formatex(szFile, charsmax(szFile), "addons/amxmodx/data/vault/CONNECTS%d.vault", str_to_num(szDate) - 2);
	
	if(file_exists(szFile))	
		delete_file(szFile);
}

public changeVault(){
	new players[32];	
	get_players(players, connects, "ch");
	
	nvault_close(hNvault);		
	nvOpen();
}

Last edited by jonny1990; 05-04-2020 at 12:53.
jonny1990 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 07:48.


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