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

CZ Notifications on 1.6


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LondoN
Senior Member
Join Date: Dec 2015
Location: Roman, Romania.
Old 01-24-2021 , 10:48   CZ Notifications on 1.6
Reply With Quote #1



I've saw some weeks ago notifications like this (instead of hud) on a CS 1.6 Server (running amxmodx).

Does anyone know how to hook something like this and insert in a CS 1.6 plugin?
Or this is a plugin that already exists (basically i need to see the code of how it works).
__________________
LondoN is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-24-2021 , 11:49   Re: CZ Notifications on 1.6
Reply With Quote #2

https://wiki.alliedmods.net/Half-lif...ents#TutorText
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
LondoN
Senior Member
Join Date: Dec 2015
Location: Roman, Romania.
Old 01-24-2021 , 12:16   Re: CZ Notifications on 1.6
Reply With Quote #3

Code:
#include < amxmodx >
#include < amxmisc >

#define PLUGIN_NAME	"[Tutor Text] Example"
#define PLUGIN_VERSION	"1.0"
#define PLUGIN_AUTHOR	"LondoN eXtream"

enum
{
	COLOR_RED = 1,
	COLOR_BLUE,
	COLOR_YELLOW,
	COLOR_GREEN
};

new g_pMessage_Tutor, g_pMessage_TutorClose;

public plugin_init ( )
{
	register_plugin ( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
	
	g_pMessage_Tutor 	=	get_user_msgid ( "TutorText" );
	g_pMessage_TutorClose	=	get_user_msgid ( "TutorClose" );

	register_clcmd ( "say /tutor", "pEntityCommand_ShowTutorMenu" );
}

public pEntityCommand_ShowTutorMenu ( pEntity )
{
	new iMenu = menu_create ( "\wCreate Tutor", "TUTOR_HANDLER" );

	menu_additem ( iMenu, "\wRed Tutor" );
	menu_additem ( iMenu, "\wBlue Tutor" );
	menu_additem ( iMenu, "\wYellow Tutor" );
	menu_additem ( iMenu, "\wGreen Tutor" );

	menu_setprop ( iMenu, MPROP_EXIT, MEXIT_ALL );
	menu_display ( pEntity, iMenu, 0 );

	return 1;
}

public TUTOR_HANDLER ( pEntity, pMenu, pKey )
{
	if ( pKey == MENU_EXIT )
	{
		menu_destroy ( pMenu );
		return 1;
	}

	new g_szSample [ 128 ];
	formatex ( g_szSample, charsmax ( g_szSample ), "This is an example text" );


	switch ( pKey )
	{
		case 0:	CreateTutor ( pEntity, g_szSample, COLOR_RED, 3.0 );
		case 1:	CreateTutor ( pEntity, g_szSample, COLOR_BLUE, 3.0 );
		case 2:	CreateTutor ( pEntity, g_szSample, COLOR_YELLOW, 3.0 );
		case 3:	CreateTutor ( pEntity, g_szSample, COLOR_GREEN, 3.0 );
	}

	return 1;
}

CreateTutor ( pEntity, g_szSample [ ], COLOR_NAME, Float: pTutorTime = 0.0 )
{
	message_begin ( MSG_ONE, g_pMessage_Tutor, {0, 0, 0}, pEntity );
	write_string ( g_szSample );
	write_byte ( 0 );
	write_short ( 0 );
	write_short ( 0 );
	write_short ( 1<<COLOR_NAME );
	message_end ( );

	if ( pTutorTime != 0.0 )
		set_task ( pTutorTime, "RemoveTutor", pEntity );
}

public RemoveTutor ( pEntity )
{
	message_begin ( MSG_ONE, g_pMessage_TutorClose, {0, 0, 0}, pEntity );
	message_end ( );
}
Just solved, thank you.
__________________
LondoN 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 10:50.


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