Raised This Month: $ Target: $400
 0% 

Timer in the last seconds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
firstride
Member
Join Date: Jun 2011
Old 07-07-2013 , 04:58   Timer in the last seconds
Reply With Quote #1

PHP Code:
#include <amxmodx>

new Float:gfNowRunda;

#define TASKID 23456

new gcvarRoundTime;

public 
plugin_init() 

    
register_plugin("Time","0.1","HARDBOT");
    
register_logevent("Start"2"1=Round_Start")
    
register_logevent("End"2"1=Round_End")

    
gcvarRoundTime get_cvar_pointer("mp_roundtime");
}
public 
Start(){
    
set_task(1.0"Pokaz"TASK,__"b");
}
public 
End(){
    
remove_task(TASKID);
}
public 
Pokaz()
{
    new 
roundtime =  floatround(gfNowRunda get_gametime(), floatround_floor);
    if(
roundtime 0){
        
set_hudmessage(016000.00.000.01.00.10.1)
        
show_hudmessage(0"T: %d"roundtime)
    }
    return 
PLUGIN_CONTINUE

This code show a hud countdown of the roundtime. I wan't to appear only in the last 30 seconds of the round .... please help. Thanks

Last edited by firstride; 07-07-2013 at 10:26.
firstride is offline
kimilover
Junior Member
Join Date: Oct 2010
Old 07-07-2013 , 05:10   Re: Timer in the last seconds
Reply With Quote #2

i am not very sure about this and i am new in this language but i believe if you change that:
PHP Code:
if (roundtime 0
to
PHP Code:
while (roundtime <= 30) {
set_hudmessage(2552552550.020.2906.01.0)
        
show_dhudmessage(0"T: %d"roundtime)

test it and if it works change the set_hudmessage for the color and position and others...

Last edited by kimilover; 07-07-2013 at 05:12.
kimilover is offline
firstride
Member
Join Date: Jun 2011
Old 07-07-2013 , 10:18   Re: Timer in the last seconds
Reply With Quote #3

At the second 30 the server crash ...

Later edit: It works with "if" not "while" , thanks

Last edited by firstride; 07-07-2013 at 10:25.
firstride is offline
kimilover
Junior Member
Join Date: Oct 2010
Old 07-07-2013 , 12:18   Re: Timer in the last seconds
Reply With Quote #4

yes the while wasnt very good choice.. i am new but your wrong was at your conditional...

Last edited by kimilover; 07-07-2013 at 12:19.
kimilover 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 06:28.


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