Jump to content

Recommended Posts

1. Nume plugin: Welcome Message (dhudmessage)
2. Autor & Versiune: falseq / 1.0
3. Comenzi: -
4. Cvar: 

Quote

mchat_displaymsg - cat timp sa fie afisat mesajul

5. Alte detalii: Cu ajutorul acestui plugin puteti adauga un mesaj care va fi afisat fiecarui jucator in parte in momentul in care se conecteaza, acest mesaj se poate customiza din fisierul de configurare (welcome_msg.ini) cu orice doriti.
6. Link download: ATENTIE! Acest plugin se compileaza cu AMXMODX 1.8.2! Versiunile mai noi nu functioneaza. - functioneaza perfect pe reHLDS (testat).

/*


				1.0: release
				
				cvar:
				
					mchat_displaymsg			[CVAR][Default: 15.0][Cat sa timp sa tina mesajul]
				
				
*/				

#include < amxmodx >
#include < amxmisc >
#include < dhudmessage >

#define PLUGIN_NAME "dhudMessage"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "falseq"

new g_File[ 128 ], g_Text[ 256 ];
new g_HudDisplay;

// Daca doresti ca mesajul sa contina si numele utilizatorului, nu modifici. Daca nu vrei, pui in fata //, gen //#define SHOW_NAME

#define SHOW_NAME

/* ==============================
	=> Red Green Blue
====================||============= */
#define RRR 		50	/* RED */	
#define GGG			50	/* GREEN */
#define BBB			130	/* BLUE */

public plugin_init( )
{
	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
	
	register_cvar( "dhudmsg_author", PLUGIN_AUTHOR, FCVAR_SERVER | FCVAR_SPONLY );
	set_cvar_string( "dhudmsg_author", PLUGIN_AUTHOR );
	
	g_HudDisplay = register_cvar( "mchat_displaymsg", "15.0" );
}

public plugin_cfg( )
{
	get_configsdir( g_File, sizeof( g_File ) -1 );
	formatex( g_File, sizeof( g_File ) -1, "%s/welcome_msg.ini", g_File );
	
	if( !file_exists( g_File ) )
	{
		write_file( g_File, "^"Welcome message^"", -1 );
	}
	
	set_task( 3.0, "openfile" );
}

public openfile( )
{
	new szFile = fopen( g_File, "r" );
	
	if( !szFile )
		return;
	
	new szData[ 256 ];
	
	while( !feof( szFile ) )
	{
		fgets( szFile, szData, sizeof( szData ) -1 );
		
		copy( g_Text, sizeof( g_Text ) -1, szData );
		break;
	}
	
	fclose( szFile );
	
	return;
}

public client_putinserver( id )
{
	set_task( 2.0, "showmsg", id );
}

public showmsg( id )
{
	new szName[ 32 ];
	get_user_name( id, szName, sizeof( szName ) -1 );
	
	#if defined SHOW_NAME 	
		set_dhudmessage( RRR, GGG, BBB, -1.0, 0.35, 0, get_pcvar_float( g_HudDisplay ) );
		show_dhudmessage( id, "[ %s ] %s", szName, g_Text );
	#else
		set_dhudmessage( RRR, GGG, BBB, -1.0, 0.35, 0, get_pcvar_float( g_HudDisplay ) );
		show_dhudmessage( id, "%s", g_Text );
	#endif
}

In folderul configs se creeaza un fisier cu numele "welcome_msg.ini" - de aici setati mesajul de bun venit (WELCOME TO OUR SERVER).
7. Poze:

9X17pRH.jpg


Sursa: extreamCS


Link-uri utile, nu ezita sa le folosesti! 😁
Counter-Strike 1.6 (AMXX) Support - click aici

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...