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

Change back to seconds!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Gh05t04
Senior Member
Join Date: Jul 2015
Old 08-20-2015 , 10:55   Change back to seconds!
Reply With Quote #1

How can I change this back to seconds?

PHP Code:
public ShowCountdown()
{
    
g_iCounter iCountTime;
    
entity_set_floatg_iCountdownEntity EV_FL_nextthink get_gametime() + 0.01 );
}

public 
fw_CountdownEntThinkiEntity )
{
    if ( 
iEntity == g_iCountdownEntity 
    {
        
set_hudmessage255 255 255 , -1.0 , -1.0 0.1 0.1 );
        
show_hudmessage"[ Countdown ends in: %d ]" , --g_iCounter );
        
        if ( 
g_iCounter )
            
entity_set_floatg_iCountdownEntity EV_FL_nextthink get_gametime() + 0.01 );
        else
            
server_cmd"sv_restartround 1" );
    }

Gh05t04 is offline
Hartmann
Senior Member
Join Date: Nov 2014
Old 08-20-2015 , 10:56   Re: Change back to seconds!
Reply With Quote #2

entity_set_float( g_iCountdownEntity , EV_FL_nextthink , get_gametime() + 1.0 );
__________________

RETAKES v1.0
github.com/alghtryer/retakes

Contact : [email protected]

BTC Donate: 1QAh1NLmeHy81LF9r8PaeGjYqHL2BBcJTx

Hartmann is offline
Gh05t04
Senior Member
Join Date: Jul 2015
Old 08-20-2015 , 11:02   Re: Change back to seconds!
Reply With Quote #3

Thank you!
Gh05t04 is offline
Gh05t04
Senior Member
Join Date: Jul 2015
Old 08-20-2015 , 11:07   Re: Change back to seconds!
Reply With Quote #4

Is it possible to add sounds to the countdown?

EDIT:

Why wont it work?

PHP Code:
public fw_CountdownEntThinkiEntity )
{
    if ( 
iEntity == g_iCountdownEntity 
    {
        switch( 
cs_get_user_teamiEntity ) )
        {
            case 
CS_TEAM_T:
       {
       
set_dhudmessagerandom256 ), random256 ), random256 ), -1.00.5 0.1 0.1 );
       
show_dhudmessage"Ainda podes renascer em: %d segundos" , --g_iCounter );
       }
        
        if ( 
g_iCounter )
            
entity_set_floatg_iCountdownEntity EV_FL_nextthink get_gametime() + 1.0 );
    }


Last edited by Gh05t04; 08-20-2015 at 11:20.
Gh05t04 is offline
Hartmann
Senior Member
Join Date: Nov 2014
Old 08-20-2015 , 11:12   Re: Change back to seconds!
Reply With Quote #5

Try...

Code:
public ShowCountdown() 
{ 
    g_iCounter = iCountTime; 
    entity_set_float( g_iCountdownEntity , EV_FL_nextthink , get_gametime() + 1.0 ); 
} 

public fw_CountdownEntThink( iEntity ) 
{ 
    if ( iEntity == g_iCountdownEntity )  
    { 
        set_hudmessage( 255 , 255 , 255 , -1.0 , -1.0 , 0 , 0.1 , 0.1 ); 
        show_hudmessage( 0 , "[ Countdown ends in: %d ]" , --g_iCounter ); 
        new temp[64]
	num_to_word(g_iCounter, temp, charsmax(temp))
	client_cmd(0,"speak ^"vox/%s^"", temp)

        if ( g_iCounter ) 
            entity_set_float( g_iCountdownEntity , EV_FL_nextthink , get_gametime() + 1.0 ); 
        else 
            server_cmd( "sv_restartround 1" ); 
    } 
}
__________________

RETAKES v1.0
github.com/alghtryer/retakes

Contact : [email protected]

BTC Donate: 1QAh1NLmeHy81LF9r8PaeGjYqHL2BBcJTx

Hartmann is offline
Gh05t04
Senior Member
Join Date: Jul 2015
Old 08-20-2015 , 11:33   Re: Change back to seconds!
Reply With Quote #6

Ive tryed to add custom sound and make the countdown only apper to CT but it wont work!

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <engine>
#include <dhudmessage>

new const VERSION[] = "1.0"

#define RESPAWN_INTERVAL    15.0

#define TASKID      1996

new contagem_1[]     = "sound/Contagem/1.mp3" 
new contagem_2[]     = "sound/Contagem/2.mp3" 
new contagem_3[]     = "sound/Contagem/3.mp3" 
new contagem_4[]     = "sound/Contagem/4.mp3" 
new contagem_5[]     = "sound/Contagem/5.mp3" 
new contagem_6[]     = "sound/Contagem/6.mp3" 
new contagem_7[]     = "sound/Contagem/7.mp3" 
new contagem_8[]     = "sound/Contagem/8.mp3" 
new contagem_9[]     = "sound/Contagem/9.mp3" 
new contagem_10[]    = "sound/Contagem/10.mp3" 

public plugin_precache() 

    
precache_generic(contagem_1); 
    
precache_generic(contagem_2); 
    
precache_generic(contagem_3); 
    
precache_generic(contagem_4); 
    
precache_generic(contagem_5); 
    
precache_generic(contagem_6); 
    
precache_generic(contagem_7); 
    
precache_generic(contagem_8); 
    
precache_generic(contagem_9); 
    
precache_generic(contagem_10); 
}

new 
bool:b_CanRespawn

new iVictim

const iCountTime 15;

new 
g_iCountdownEntity;
new 
g_iCounter;

public 
plugin_init()
{
    
register_plugin"Time Respawn"VERSION"Wrecked" // :avast:
    
    
g_iCountdownEntity create_entity"info_target" );
    
entity_set_stringg_iCountdownEntity EV_SZ_classname "countdown_entity" );
    
register_think"countdown_entity" "fw_CountdownEntThink" );
    
    
register_event"HLTV""EVENT_NewRound""a""1=0""2=0" )
    
register_event"HLTV""ShowCountdown""a""1=0""2=0" )
    
register_event"DeathMsg""EVENT_DeathMsg""a" )
}

public 
EVENT_NewRound()
{
    
remove_taskiVictim )
    
    
remove_taskTASKID )
    
set_taskRESPAWN_INTERVAL"TASK_SetBool"TASKID )
    
    
b_CanRespawn true
}

public 
TASK_SetBool()
{
    
b_CanRespawn false
}

public 
EVENT_DeathMsg()
{
    
iVictim read_data)
    
    if( 
b_CanRespawn )
    {
        
set_task0.5"TASK_Revive"iVictim )
    }
}

public 
TASK_Reviveid )
{
    if( !
is_user_aliveid ) )
    {
        
ExecuteHamBHam_CS_RoundRespawnid )
    }
}

public 
ShowCountdown() 

    
g_iCounter iCountTime
    
entity_set_floatg_iCountdownEntity EV_FL_nextthink get_gametime() + 1.0 ); 


public 
fw_CountdownEntThinkiEntity 

    if ( 
iEntity == g_iCountdownEntity )  
    { 
        switch( 
cs_get_user_teamid ) )
        {
            case 
CS_TEAM_CT:
       {
       
set_dhudmessagerandom256 ), random256 ), random256 ), -1.00.5 0.1 0.1 );
       
show_dhudmessage"Ainda podes renascer em: %d segundos" , --g_iCounter ); 
            
show_hudmessage(0,"Ainda podes renascer em: %d segundos" , --g_iCounter ); 
            new 
temp[64]
            
num_to_word(g_iCountertempcharsmax(temp))
            
client_cmd(0,"speak ^"sound/%s^""temp)

        if ( 
g_iCounter 
            
entity_set_floatg_iCountdownEntity EV_FL_nextthink get_gametime() + 1.0 );
    } 


Last edited by Gh05t04; 08-20-2015 at 11:34.
Gh05t04 is offline
Hartmann
Senior Member
Join Date: Nov 2014
Old 08-20-2015 , 12:31   Re: Change back to seconds!
Reply With Quote #7

Try...

Code:
public fw_CountdownEntThink( iEntity ) 
{ 
	if ( iEntity == g_iCountdownEntity )  
	{ 
		new players[32], num
		get_players(players, num, "e","CT")
		for( --num; num >= 0; num-- )
		{
			set_hudmessage( 255 , 255 , 255 , -1.0 , -1.0 , 0 , 0.1 , 0.1 ); 
			show_hudmessage( players[num] , "[ Countdown ends in: %d ]" , --g_iCounter ); 
			new temp[64]
			num_to_word(g_iCounter, temp, charsmax(temp))
			client_cmd(players[num],"speak ^"vox/%s^"", temp)
		}
		if ( g_iCounter ) 
			entity_set_float( g_iCountdownEntity , EV_FL_nextthink , get_gametime() + 1.0 ); 
		else 
			server_cmd( "sv_restartround 1" ); 
	} 
}
__________________

RETAKES v1.0
github.com/alghtryer/retakes

Contact : [email protected]

BTC Donate: 1QAh1NLmeHy81LF9r8PaeGjYqHL2BBcJTx

Hartmann 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 21:31.


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