Raised This Month: $12 Target: $400
 3% 

Countdown Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Gh05t04
Senior Member
Join Date: Jul 2015
Old 08-26-2015 , 09:47   Countdown Problem
Reply With Quote #1

Why does the countdown starts with 104390593 seconds?

But still restarts it in 20 seconds and displays the 0 seconds, can someone help me?

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

#define PLUGIN "Auto Restart vl"  
#define VERSION "1.3"  
#define AUTHOR "vato loco [GE-S]"  

#define TIMER_TASK        123456  
#define RESTART_TASK      789123  

new g_counter   

new g_autorestart  
new g_autoenabled  
new g_autocds  

new bool:g_bRoundStart  

public plugin_init()  
{  
   
register_plugin(PLUGINVERSIONAUTHOR)  
     
   
register_logevent("RoundStart"2"1=Round_Start")  
   
register_event("TextMsg","RestartTask","a","2&#Game_C")     
     
   
register_dictionary("auto_restart_vl.txt")  
     
   
g_autoenabled register_cvar("amx_autorr_enable","1")  
   
g_autocds register_cvar("amx_autorr_cds","1")  
   
g_autorestart register_cvar("amx_auto_restart","30")   
}  

public 
RoundStart()  
{  
   if(!
get_pcvar_num(g_autoenabled))  
      return 
PLUGIN_HANDLED  
     
   
if(g_bRoundStart)  
   {  
      
set_dhudmessage02550, -1.00.4015.08.00.00.0true)  
      
show_dhudmessage0"%L",LANG_PLAYER"GAME_STARTED")  
   }  
   
g_bRoundStart false  
     
   
return PLUGIN_CONTINUE  
}  

public 
RestartTask()  
{  
   if(!
get_pcvar_num(g_autoenabled))  
      return 
PLUGIN_HANDLED  
     
   set_task
(1.0,"TimeCounter",TIMER_TASK,_,_,"a",get_pcvar_num(g_autorestart)) 
   
set_task(get_pcvar_float(g_autorestart),"RestartRound",RESTART_TASK)  
     
   return 
PLUGIN_CONTINUE  
}  

public 
TimeCounter()  
{  
   
g_counter++  
     
   new 
Float:iRestartTime get_pcvar_float(g_autorestart) - g_counter  
   
new Float:fSec  
   fSec 
iRestartTime  
     
   set_dhudmessage
0255255, -1.00.2500.01.00.00.0true)  
   
show_dhudmessage0"%L",LANG_PLAYER"AUTO_RESTART"fSec)  
     
   if(
get_pcvar_num(g_autocds) && get_pcvar_num(g_autorestart) - g_counter 11 && get_pcvar_num(g_autorestart) - g_counter !=0
   {  
      static 
szNum[32]  
      
num_to_word(get_pcvar_num(g_autorestart) - g_counterszNum31)  
      
client_cmd(0,"speak ^"vox/%s^""szNum)  
   }  
   if(
g_counter == get_pcvar_num(g_autorestart))  
   {  
      
g_bRoundStart true  
      g_counter 
0  
   
}  
}  

public 
RestartRound()  
{  
   
server_cmd("sv_restartround 1")  

Gh05t04 is offline
Dr Zayd
Senior Member
Join Date: Jun 2014
Location: forums.alliedmods.net
Old 08-26-2015 , 10:25   Re: Countdown Problem
Reply With Quote #2

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

#define PLUGIN "Auto Restart vl"   
#define VERSION "1.3"   
#define AUTHOR "vato loco [GE-S]"   

#define TIMER_TASK        20   
#define RESTART_TASK      1   

new g_counter    

new g_autorestart   
new g_autoenabled   
new g_autocds   

new bool:g_bRoundStart   

public plugin_init()   
{   
   
register_plugin(PLUGINVERSIONAUTHOR)   
      
   
register_logevent("RoundStart"2"1=Round_Start")   
   
register_event("TextMsg","RestartTask","a","2&#Game_C")      
      
   
register_dictionary("auto_restart_vl.txt")   
      
   
g_autoenabled register_cvar("amx_autorr_enable","1")   
   
g_autocds register_cvar("amx_autorr_cds","1")   
   
g_autorestart register_cvar("amx_auto_restart","30")    
}   

public 
RoundStart()   
{   
   if(!
get_pcvar_num(g_autoenabled))   
      return 
PLUGIN_HANDLED   
      
   
if(g_bRoundStart)   
   {   
      
set_dhudmessage02550, -1.00.4015.08.00.00.0true)   
      
show_dhudmessage0"%L",LANG_PLAYER"GAME_STARTED")   
   }   
   
g_bRoundStart false   
      
   
return PLUGIN_CONTINUE   
}   

public 
RestartTask()   
{   
   if(!
get_pcvar_num(g_autoenabled))   
      return 
PLUGIN_HANDLED   
      
   set_task
(1.0,"TimeCounter",TIMER_TASK,_,_,"a",get_pcvar_num(g_autorestart))  
   
set_task(get_pcvar_float(g_autorestart),"RestartRound",RESTART_TASK)   
      
   return 
PLUGIN_CONTINUE   
}   

public 
TimeCounter()   
{   
   
g_counter++   
      
   new 
Float:iRestartTime get_pcvar_float(g_autorestart) - g_counter   
   
new Float:fSec   
   fSec 
iRestartTime   
      
   set_dhudmessage
0255255, -1.00.2500.01.00.00.0true)   
   
show_dhudmessage0"%L",LANG_PLAYER"AUTO_RESTART"fSec)   
      
   if(
get_pcvar_num(g_autocds) && get_pcvar_num(g_autorestart) - g_counter 11 && get_pcvar_num(g_autorestart) - g_counter !=0)  
   {   
      static 
szNum[32]   
      
num_to_word(get_pcvar_num(g_autorestart) - g_counterszNum31)   
      
client_cmd(0,"speak ^"vox/%s^""szNum)   
   }   
   if(
g_counter == get_pcvar_num(g_autorestart))   
   {   
      
g_bRoundStart true   
      g_counter 
0   
   
}   
}   

public 
RestartRound()   
{   
   
server_cmd("sv_restartround 1")   

Try this ?
Dr Zayd is offline
Gh05t04
Senior Member
Join Date: Jul 2015
Old 08-26-2015 , 11:31   Re: Countdown Problem
Reply With Quote #3

This still happens!
Attached Thumbnails
Click image for larger version

Name:	name.png
Views:	162
Size:	88.6 KB
ID:	147731  
Gh05t04 is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 08-26-2015 , 12:02   Re: Countdown Problem
Reply With Quote #4

Code:
#define TIMER_TASK 65474
sv_restartround 1?

try:
Code:
sv_restart 1
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Gh05t04
Senior Member
Join Date: Jul 2015
Old 08-26-2015 , 12:34   Re: Countdown Problem
Reply With Quote #5

It wont work!
Gh05t04 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-26-2015 , 12:50   Re: Countdown Problem
Reply With Quote #6

PHP Code:
 get_pcvar_float(g_autorestart
->
PHP Code:
float(get_pcvar_int(g_autorestart)) 
__________________
HamletEagle is offline
Gh05t04
Senior Member
Join Date: Jul 2015
Old 08-26-2015 , 14:41   Re: Countdown Problem
Reply With Quote #7

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Error: Undefined symbol "get_pcvar_int" on line 54
Error: Undefined symbol "get_pcvar_int" on line 63
Error: Expected token: ",", but found "new" on line 63

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

#define PLUGIN "Auto Restart vl"  
#define VERSION "1.3"  
#define AUTHOR "vato loco [GE-S]"  

#define TIMER_TASK        123456  
#define RESTART_TASK      789123  

new g_counter   

new g_autorestart  
new g_autoenabled  
new g_autocds  

new bool:g_bRoundStart  

public plugin_init()  
{  
   
register_plugin(PLUGINVERSIONAUTHOR)  
     
   
register_logevent("RoundStart"2"1=Round_Start")  
   
register_event("TextMsg","RestartTask","a","2&#Game_C")     
     
   
register_dictionary("auto_restart_vl.txt")  
     
   
g_autoenabled register_cvar("amx_autorr_enable","1")  
   
g_autocds register_cvar("amx_autorr_cds","1")  
   
g_autorestart register_cvar("amx_auto_restart","20.0")   
}  

public 
RoundStart()  
{  
   if(!
get_pcvar_num(g_autoenabled))  
      return 
PLUGIN_HANDLED  
     
   
if(g_bRoundStart)  
   {  
      
set_dhudmessage02550, -1.00.4015.08.00.00.0true)  
      
show_dhudmessage0"%L",LANG_PLAYER"GAME_STARTED")  
   }  
   
g_bRoundStart false  
     
   
return PLUGIN_CONTINUE  
}  

public 
RestartTask()  
{  
   if(!
get_pcvar_num(g_autoenabled))  
      return 
PLUGIN_HANDLED  
     
   set_task
(1.0,"TimeCounter",TIMER_TASK,_,_,"a",get_pcvar_num(g_autorestart)) 
   
set_task(float(get_pcvar_int(g_autorestart)),"RestartRound",RESTART_TASK)  
     
   return 
PLUGIN_CONTINUE  
}  

public 
TimeCounter()  
{  
   
g_counter++  
     
   new 
Float:iRestartTime float(get_pcvar_int(g_autorestart)) - g_counter  
   
new Float:fSec  
   fSec 
iRestartTime  
     
   set_dhudmessage
0255255, -1.00.2500.01.00.00.0true)  
   
show_dhudmessage0"%L",LANG_PLAYER"AUTO_RESTART"fSec)  
     
   if(
get_pcvar_num(g_autocds) && get_pcvar_num(g_autorestart) - g_counter 11 && get_pcvar_num(g_autorestart) - g_counter !=0
   {  
      static 
szNum[32]  
      
num_to_word(get_pcvar_num(g_autorestart) - g_counterszNum31)  
      
client_cmd(0,"speak ^"vox/%s^""szNum)  
   }  
   if(
g_counter == get_pcvar_num(g_autorestart))  
   {  
      
g_bRoundStart true  
      g_counter 
0  
   
}  
}  

public 
RestartRound()  
{  
   
server_cmd("sv_restartround 1")  

3 Errors.
Could not locate output file C:\Users\ferre\Desktop\Compiler\compiled\Rini ciarAuto.amx (compile failed).
Gh05t04 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-27-2015 , 03:37   Re: Countdown Problem
Reply With Quote #8

Ooops, get_pcvar_num, sorry for the typo.
__________________
HamletEagle is offline
Gh05t04
Senior Member
Join Date: Jul 2015
Old 08-27-2015 , 06:50   Re: Countdown Problem
Reply With Quote #9

It still wont work, it still appers alot of numbers, what is wrong?
Gh05t04 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 14:02.


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