AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Timeleft instead of Round timer (https://forums.alliedmods.net/showthread.php?t=64785)

st0kata 12-24-2007 15:34

Timeleft instead of Round timer
 
Hi guys,
I couldn't figure out how to display map timeleft instead of the round time. Can anyone help me ? :/

travo 12-25-2007 14:21

Re: Timeleft instead of Round timer
 
I think this is what your wanting

PHP Code:

#include <amxmodx>

#define PLUGIN "Timeleft Hud"
#define VERSION "1.0"
#define AUTHOR "WhooKid"

new Toggle,FreezeTime,ShowTimer,RoundTime,Scenario;

public 
plugin_init() 
{
    
register_plugin(PLUGIN,VERSION,AUTHOR);
    
register_cvar(PLUGIN,VERSION,FCVAR_SPONLY|FCVAR_SERVER);
    
    
register_event("ResetHUD","player_resethud","b");

    
Toggle register_cvar("amx_timelefthud","1");
    
FreezeTime get_cvar_num("mp_freezetime");
    
ShowTimer get_user_msgid("ShowTimer");
    
RoundTime get_user_msgid("RoundTime");
    
Scenario get_user_msgid("Scenario");
}

public 
player_resethud(id)
{
    if (
get_pcvar_num(Toggle))
        
set_task(float(FreezeTime),"player_timeleft",id);
}

public 
player_timeleft(id)
{
    new 
timeleft get_timeleft();
    if (
is_user_connected(id) && timeleft<9999 && timeleft>0)
    {
        
message_begin(MSG_ONE_UNRELIABLE,ShowTimer,_,id);
        
message_end();
    
        
message_begin(MSG_ONE_UNRELIABLE,RoundTime,_,id);
        
write_short(timeleft);
        
message_end();
    
        
message_begin(MSG_ONE_UNRELIABLE,Scenario,_,id);
        
write_byte(1);
        
write_string("minus");
        
write_byte(150);
        
write_short(0);
        
message_end();
    }



st0kata 12-25-2007 14:48

Re: Timeleft instead of Round timer
 
thank you travo that's it :)

Pokemon 03-30-2008 13:39

Re: Timeleft instead of Round timer
 
Creo que es el plugin que ando buscando (sorry my spanish)


All times are GMT -4. The time now is 11:12.

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