AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Detect Round Time 0:00 (https://forums.alliedmods.net/showthread.php?t=53791)

Dark Killer 04-11-2007 02:09

Detect Round Time 0:00
 
I am writing a plugin and I removes all bombsites, hostage zones.

When the round time reaches 0:00, the game wont go to next round.

So I want the game restarts (sv_restart 1) when the round time becomes 0:00.

How to detect it?? Thanks for your help!

Alka 04-11-2007 03:30

Re: Detect Round Time 0:00
 
1. http://forums.alliedmods.net/showthread.php?p=209931 (already done)
2. Try this for roundtime /restart =>>
PHP Code:

#include <amxmodx>
 
#define PLUGIN ""
#define VERSION ""
#define AUTHOR ""
 
new g_roundtimepointnum;

public 
plugin_init() {
 
register_plugin(PLUGINVERSIONAUTHOR)
 
 
pointnum get_cvar_pointer("mp_roundtime");
}
public 
something() {
 
 
g_roundtime get_pcvar_num(pointnum);
 
 if(
g_roundtime == 0) {
  
  
server_cmd("sv_restart 3")
 }
 



Dark Killer 04-11-2007 06:29

Re: Detect Round Time 0:00
 
Thanks!! +karma :up:

But wad is somthing o.O

Alka 04-11-2007 06:34

Re: Detect Round Time 0:00
 
=)) is name of public! put another name... :)

Dark Killer 04-11-2007 06:58

Re: Detect Round Time 0:00
 
i mean how to trigger it??

Alka 04-11-2007 07:05

Re: Detect Round Time 0:00
 
...In this form plugin must work!...dunno what you mean...

EDIT:np :wink:

Dark Killer 04-11-2007 07:05

Re: Detect Round Time 0:00
 
oh... Sorry. Thanks!

VEN 04-15-2007 12:16

Re: Detect Round Time 0:00
 
Alka's code will not work. I believe he just thought that you need to check if mp_roundtime CVar value is equal to 0. But this is not the case here.

This is the only way to do it
Code:
#include <amxmodx> #define TASK_ID 934279423 new g_pcvar_mp_roundtime public plugin_init() {         register_event("HLTV", "remove_existing_task", "a", "1=0", "2=0")         register_logevent("logevent_round_start", 2, "1=Round_Start")         register_logevent("remove_existing_task", 3, "2=Planted_The_Bomb")         g_pcvar_mp_roundtime = get_cvar_pointer("mp_roundtime") } public logevent_round_start() {         set_task(float(floatround(get_pcvar_float(g_pcvar_mp_roundtime) * 60.0, floatround_floor)), "time_is_up", TASK_ID) } public time_is_up() {         set_cvar_num("sv_restart", 1) } public remove_existing_task() {         if (task_exists(TASK_ID))                 remove_task(TASK_ID) }

hleV 12-03-2007 08:21

Re: Detect Round Time 0:00
 
Can I make "Counter-Terrorists Win!" event instead of restarting the round? If yes, please give me the code.

hleV 12-13-2007 08:35

Re: Detect Round Time 0:00
 
The thing what i ment is to change the round restart event to CTs win event.


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

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