Raised This Month: $ Target: $400
 0% 

Add a coundown like 10, 9, 8, 7, 6....0 for a restart plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RCC|Dynamite
Senior Member
Join Date: May 2004
Location: Germany
Old 06-08-2006 , 06:04   Add a coundown like 10, 9, 8, 7, 6....0 for a restart plugin
Reply With Quote #1

Quote:
Originally Posted by SweatyBanana
Code:
#include <amxmodx> public plugin_init() {     register_plugin("Auto-Restart","1.0","SweatyBanana")     set_task(3600.0,"drestart")     return PLUGIN_CONTINUE } public drestart() {     server_cmd("sv_restartround 1") }
Is ist possible to add a coundown like 10, 9, 8, 7, 6......0 as by a mapschange
__________________

|###########|
|###########|
|###########|
RCC|Dynamite is offline
Send a message via ICQ to RCC|Dynamite
VEN
Veteran Member
Join Date: Jan 2005
Old 06-08-2006 , 06:33  
Reply With Quote #2

Yes, look into timeleft.sma for example.
VEN is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-08-2006 , 06:36  
Reply With Quote #3

Code:
#include <amxmodx> #define RESTART_TIME 3600 new g_countdown = RESTART_TIME; public plugin_init() {     register_plugin("Auto-Restart" , "1.0" , "v3x")     set_task(1.0 , "countdown" , 918231 , _ , _ , "b") } public countdown() {     g_countdown--;     switch(g_countdown)     {       case 2 .. 10: client_print(0 , print_center , "Round restarting in %d seconds" , g_countdown);       case 1:       {         set_cvar_num("sv_restartround" , 1);         g_countdown = RESTART_TIME;       }     } }
something like that.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
RCC|Dynamite
Senior Member
Join Date: May 2004
Location: Germany
Old 06-08-2006 , 07:01  
Reply With Quote #4

Quote:
Originally Posted by VEN
Yes, look into timeleft.sma for example.
I`m Sorry i had not thought to it.

How can i display the remaining time in to the chat?

The timeleft sound 10 min. remaining at the same time as "10 min. to restart" as say in the chat

THX v3x for support!!!

greez

Dynamite
__________________

|###########|
|###########|
|###########|
RCC|Dynamite is offline
Send a message via ICQ to RCC|Dynamite
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-08-2006 , 07:07  
Reply With Quote #5

Code:
#include <amxmodx> #define RESTART_TIME 3600 new g_countdown = RESTART_TIME; public plugin_init() {     register_plugin("Auto-Restart" , "1.1" , "v3x")     set_task(1.0 , "countdown" , 918231 , _ , _ , "b") } public countdown() {     g_countdown--;     switch(g_countdown)     {         case 2999 .. 3000: client_print(0 , print_chat , "* Round restarting in 10 minutes");         case 2 .. 10: client_print(0 , print_center , "Round restarting in %d seconds" , g_countdown);         case 0 .. 1:         {           set_cvar_num("sv_restartround" , 1);           g_countdown = RESTART_TIME;         }     } }
should work if I understand you correctly ;-)
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
RCC|Dynamite
Senior Member
Join Date: May 2004
Location: Germany
Old 06-08-2006 , 07:11  
Reply With Quote #6

Code:
public countdown() {     g_countdown--;     switch(g_countdown)     {         case 2999 .. 3000: client_print(0 , print_chat , "* Round restarting in 45 minutes");         case 2999 .. 3000: client_print(0 , print_chat , "* Round restarting in 30 minutes");         case 2999 .. 3000: client_print(0 , print_chat , "* Round restarting in 15 minutes");         case 2999 .. 3000: client_print(0 , print_chat , "* Round restarting in 5 minutes");         case 2 .. 10: client_print(0 , print_center , "Round restarting in %d seconds" , g_countdown);         case 1:         {           set_cvar_num("sv_restartround" , 1);           g_countdown = RESTART_TIME;         }     } }


Big THX work this too? But how can i add the voice saying?
__________________

|###########|
|###########|
|###########|
RCC|Dynamite is offline
Send a message via ICQ to RCC|Dynamite
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-08-2006 , 07:15  
Reply With Quote #7

Code:
 public countdown() {     g_countdown--;     switch(g_countdown)     {         case 2700: client_print(0 , print_chat , "* Round restarting in 45 minutes");         case 1800: client_print(0 , print_chat , "* Round restarting in 30 minutes");         case 900: client_print(0 , print_chat , "* Round restarting in 15 minutes");         case 300: client_print(0 , print_chat , "* Round restarting in 5 minutes");         case 2 .. 10: client_print(0 , print_center , "Round restarting in %d seconds" , g_countdown);         case 1:         {           set_cvar_num("sv_restartround" , 1);           g_countdown = RESTART_TIME;         }     } }

For the sounds you need to lookup FVOX and find the words then do:
Code:
client_cmd(0 , "spk ^"fvox/five^"");
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
RCC|Dynamite
Senior Member
Join Date: May 2004
Location: Germany
Old 06-08-2006 , 07:36  
Reply With Quote #8

I think that is the last question^^

Code:
#include <amxmodx> #define RESTART_TIME 3600 new g_countdown = RESTART_TIME; public plugin_init() {     register_plugin("Auto-Restart" , "1.1" , "v3x")     set_task(1.0 , "countdown" , 918231 , _ , _ , "b") }   public countdown() {     g_countdown--;     switch(g_countdown)     {         case 2700: client_print(0 , print_chat , "* Round restarting in 45 minutes");client_cmd(0 , "spk ^"fvox/fortyfive^"");         case 1800: client_print(0 , print_chat , "* Round restarting in 30 minutes");client_cmd(0 , "spk ^"fvox/thirty^"");         case 900: client_print(0 , print_chat , "* Round restarting in 15 minutes");client_cmd(0 , "spk ^"fvox/fifteen^"");         case 300: client_print(0 , print_chat , "* Round restarting in 5 minutes");client_cmd(0 , "spk ^"fvox/five^"");         case 2 .. 10: client_print(0 , print_center , "Round restarting in %d seconds" , g_countdown);         case 1:         {           set_cvar_num("sv_restartround" , 1);           g_countdown = RESTART_TIME;         }     } }

Is it so right?
__________________

|###########|
|###########|
|###########|
RCC|Dynamite is offline
Send a message via ICQ to RCC|Dynamite
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 06-08-2006 , 08:12  
Reply With Quote #9

Read my server restart plugin.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-08-2006 , 08:13  
Reply With Quote #10

I'm not sure. Test it ;)
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x 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 16:22.


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