 |
|
Junior Member
|

08-20-2019
, 13:33
Re: How to show hud to individual players
|
#5
|
Quote:
Originally Posted by edon1337
Post in Suggestion/Request section if you're a beginner. Scripting help section is intended for people who at least have basic knowledge in scripting.
I don't know why you're setting a task, but here you go.
PHP Code:
#include < amxmodx >
enum ( += 1234 )
{
TASK_TIME,
TASK_TIMELEFT
}
public plugin_init( )
{
register_clcmd( "say /thetime", "The_time" );
register_clcmd( "say_team /thetime", "The_time" );
register_clcmd( "say /timeleft", "Timeleft" );
register_clcmd( "say_team /timeleft", "Timeleft" );
}
public The_time( id )
{
if( task_exists( id + TASK_TIME ) )
{
remove_task( TASK_TIME );
}
set_task( 1.0, "TaskTime", ( id + TASK_TIME ) );
}
public Timeleft( id )
{
if( task_exists( id + TASK_TIMELEFT ) )
{
remove_task( TASK_TIMELEFT );
}
set_task( 1.0, "TaskTimeLeft", ( id + TASK_TIMELEFT ) );
}
public TaskTime( id )
{
id -= TASK_TIME;
static szTime[ 32 ];
get_time( "%H:%M:%S", szTime, charsmax( szTime ) );
set_hudmessage( 255, 0, 0, 0.95, 0.01, 0, 0.1, 0.9, 0.1, 0.1, -1 );
show_hudmessage( id, "Time: %s", szTime );
}
public TaskTimeLeft( id )
{
id -= TASK_TIMELEFT;
static iTimeleft;
iTimeleft = get_timeleft( );
set_hudmessage( 255, 0, 0, 0.95, 0.03, 0, 0.1, 0.9, 0.1, 0.1, -1 );
show_hudmessage( id, "Timeleft: %d:%02d", ( iTimeleft / 60 ), ( iTimeleft % 60 ) );
}
|
Lol I'm not a beginner it wasn't about this plugin specifically this was a example I'm using it for something else thx though
|
|
|
|