Raised This Month: $32 Target: $400
 8% 

[REQ] help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
killer999
Senior Member
Join Date: Dec 2013
Location: India
Old 02-24-2018 , 06:30   [REQ] help
Reply With Quote #1

can anyone add a custom sound when the dhud message is dsiplayed ?

Code:
#include < amxmodx >
#include <dhudmessage>

new g_Color[ 64 ][ 15 ], g_Hud[ 64 ][ 120 ], g_HudCount, g_HudMessage

public plugin_init( ) {

	register_plugin( "Hud Message Plugin", "6.2", "Leotrimz" );

	set_task( 3.5, "GetMsg" ); 
	set_task( 35.0, "SendMsg", .flags = "b" );
}

public GetMsg( ) {
	static file, line_from_file[ 161 ];
	file = fopen( "addons/amxmodx/configs/messages.ini", "r" );
	while( !feof( file ) ) {
		fgets( file, line_from_file, 160 ), trim( line_from_file );
		if( strlen( line_from_file ) > 4 ) parse( line_from_file, g_Color[ g_HudCount ], 14, g_Hud[ g_HudCount ], 119 ), replace_all( g_Hud[ g_HudCount ], 119, "\n", "^n" ), g_HudCount++;
	}
	fclose( file );
}

public SendMsg( ) 
{
	if( g_HudMessage >= g_HudCount )
		g_HudMessage = 0;

	set_dhudmessage( str_to_num( g_Color[ g_HudMessage ][ 0 ] ), str_to_num( g_Color[ g_HudMessage ][ 3 ] ), str_to_num( g_Color[ g_HudMessage ][ 7 ] ), -1.0, 0.20, 2, 0.20, 12.0, 0.10, 0.01, -1 ),
	show_dhudmessage( 0, "%s", g_Hud[ g_HudMessage ] ), client_print( 0, print_console, "%s", g_Hud[ g_HudMessage ] ), g_HudMessage++;
}
__________________
killer999 is offline
Send a message via Skype™ to killer999
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 02-24-2018 , 11:51   Re: [REQ] help
Reply With Quote #2

Precache + Emit Sound
__________________
Relaxing is offline
Reply


Thread Tools
Display Modes

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 03:02.


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