Raised This Month: $ Target: $400
 0% 

I need a help, please;(


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
prost1
Junior Member
Join Date: Nov 2014
Old 11-19-2014 , 02:17   I need a help, please;(
Reply With Quote #1

Hello guys. This plugin showed score hud on up.
Hud activation only start infection, but not starting round.
Help please
I can use public event_roundstart but plugin can't start, disable..

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

#define PLUGIN_NAME "[ZP] DHUD Informer"
#define PLUGIN_VERSION "0.0.0.1"
#define PLUGIN_AUTHOR "Andrei"

enum _: eTeamData
{
	WIN_NO_ONE = 0,
	WIN_ZOMBIES,
	WIN_HUMANS	

}; new g_iWin[ eTeamData ];

public plugin_init() 
{
    	register_plugin
	( 
		PLUGIN_NAME, 
		PLUGIN_VERSION, 
		PLUGIN_AUTHOR
	);

	register_dictionary( "zp_score.txt" );
	register_message( get_user_msgid( "TextMsg" ), "Message_TextMsg" );
}

public Message_TextMsg( ) 
{
	static szMessages[ 32 ];
	get_msg_arg_string( 2, szMessages, charsmax( szMessages ) );
	
	if( equal( szMessages, "#Game_will_restart_in" ) )
	{
		g_iWin[ WIN_HUMANS ] = 0;
		g_iWin[ WIN_ZOMBIES ] = 0;
		g_iWin[ WIN_NO_ONE ] = 0;
	} 
}

public zp_round_started( )
{
	set_task( 1.0, "Ctask__Update", _ ,_ ,_ , .flags = "b" );
}  

public zp_round_ended( iWinTeam )
{
	switch( iWinTeam )
	{
		case WIN_HUMANS: g_iWin[ WIN_HUMANS ]++;
		case WIN_ZOMBIES: g_iWin[ WIN_ZOMBIES ]++;
		default: g_iWin[ WIN_NO_ONE ]++;
	}

	remove_task();
}  


public Ctask__Update( )
{
	set_dhudmessage( .red = 0, .green = 255, .blue = 100, .x = -1.0, .y = 0.02, .effects = 0, .fxtime = 6.0, .holdtime = 2.0, .fadeintime = 1.0, .fadeouttime = 1.0, .reliable = false ); 
	show_dhudmessage( 0, "%L                        ", LANG_PLAYER, "SCORE_HUMANS", zp_get_human_count() );
	set_dhudmessage( .red = 255, .green = 255, .blue = 20, .x = -1.0, .y = 0.02, .effects = 0, .fxtime = 6.0, .holdtime = 2.0, .fadeintime = 1.0, .fadeouttime = 1.0, .reliable = false ); 
	show_dhudmessage( 0, "%L^n%L", LANG_PLAYER, "SCORE_ROUND", ( g_iWin[ WIN_HUMANS ] +  g_iWin[ WIN_ZOMBIES ] + g_iWin[ WIN_NO_ONE ] ), LANG_PLAYER,  "SCORE_WINS", g_iWin[ WIN_HUMANS ],  g_iWin[ WIN_ZOMBIES ] );
	set_dhudmessage( .red = 255, .green = 0, .blue = 0, .x = -1.0, .y = 0.02, .effects = 0, .fxtime = 6.0, .holdtime = 2.0, .fadeintime = 1.0, .fadeouttime = 1.0, .reliable = false ); 
	show_dhudmessage( 0, "                         %L", LANG_PLAYER, "SCORE_ZOMBIES", zp_get_zombie_count() );
}
prost1 is offline
prost1
Junior Member
Join Date: Nov 2014
Old 11-19-2014 , 02:18   Re: I need a help, please;(
Reply With Quote #2

If delete zp_round_start and write event_roundstart, he disable..
prost1 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 11-19-2014 , 03:08   Re: I need a help, please;(
Reply With Quote #3

Just change this:
PHP Code:
public zp_round_started( )
{
    
set_task1.0"Ctask__Update",,, .flags "b" );

-->
PHP Code:
public client_putinserver( )
{
    
set_task1.0"Ctask__Update",,, .flags "b" );


Last edited by zmd94; 11-19-2014 at 03:09.
zmd94 is offline
prost1
Junior Member
Join Date: Nov 2014
Old 11-19-2014 , 12:28   Re: I need a help, please;(
Reply With Quote #4

Oh thank you more!
prost1 is offline
prost1
Junior Member
Join Date: Nov 2014
Old 11-19-2014 , 13:40   Re: I need a help, please;(
Reply With Quote #5

Quote:
Originally Posted by zmd94 View Post
Just change this:
PHP Code:
public zp_round_started( )
{
    
set_task1.0"Ctask__Update",,, .flags "b" );

-->
PHP Code:
public client_putinserver( )
{
    
set_task1.0"Ctask__Update",,, .flags "b" );

Ok/ This work!
BUT. When started new round score hud not works!
He work only first round and next rounds not work!
prost1 is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 11-19-2014 , 14:08   Re: I need a help, please;(
Reply With Quote #6

Remove this from round end function: remove_task()

Put the set_task in plugin_init instead of putinserver
__________________
Jhob94 is offline
prost1
Junior Member
Join Date: Nov 2014
Old 11-19-2014 , 17:19   Re: I need a help, please;(
Reply With Quote #7

Quote:
Originally Posted by Jhob94 View Post
Remove this from round end function: remove_task()

Put the set_task in plugin_init instead of putinserver
Now hud flashing, offen flashing
prost1 is offline
prost1
Junior Member
Join Date: Nov 2014
Old 11-19-2014 , 17:23   Re: I need a help, please;(
Reply With Quote #8

He show hud not always
prost1 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 11-19-2014 , 17:26   Re: I need a help, please;(
Reply With Quote #9

Just remove the red line.
Code:
public zp_round_ended( iWinTeam )
{
    switch( iWinTeam )
    {
        case WIN_HUMANS: g_iWin[ WIN_HUMANS ]++;
        case WIN_ZOMBIES: g_iWin[ WIN_ZOMBIES ]++;
        default: g_iWin[ WIN_NO_ONE ]++;
    }

    remove_task();
}
zmd94 is offline
prost1
Junior Member
Join Date: Nov 2014
Old 11-19-2014 , 18:00   Re: I need a help, please;(
Reply With Quote #10

Quote:
Originally Posted by zmd94 View Post
Just remove the red line.
Code:
public zp_round_ended( iWinTeam )
{
    switch( iWinTeam )
    {
        case WIN_HUMANS: g_iWin[ WIN_HUMANS ]++;
        case WIN_ZOMBIES: g_iWin[ WIN_ZOMBIES ]++;
        default: g_iWin[ WIN_NO_ONE ]++;
    }

    remove_task();
}
Ok
Then he don't show hud
prost1 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 17:40.


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