Raised This Month: $ Target: $400
 0% 

Detect Round Time 0:00


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dark Killer
Senior Member
Join Date: May 2005
Location: Kowloon, Hong Kong
Old 04-11-2007 , 02:09   Detect Round Time 0:00
Reply With Quote #1

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!
__________________

Last edited by Dark Killer; 04-11-2007 at 03:07.
Dark Killer is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 04-11-2007 , 03:30   Re: Detect Round Time 0:00
Reply With Quote #2

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")
 }
 

__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Dark Killer
Senior Member
Join Date: May 2005
Location: Kowloon, Hong Kong
Old 04-11-2007 , 06:29   Re: Detect Round Time 0:00
Reply With Quote #3

Thanks!! +karma

But wad is somthing o.O
__________________

Last edited by Dark Killer; 04-11-2007 at 06:31.
Dark Killer is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 04-11-2007 , 06:34   Re: Detect Round Time 0:00
Reply With Quote #4

=)) is name of public! put another name...
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Dark Killer
Senior Member
Join Date: May 2005
Location: Kowloon, Hong Kong
Old 04-11-2007 , 06:58   Re: Detect Round Time 0:00
Reply With Quote #5

i mean how to trigger it??
__________________
Dark Killer is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 04-11-2007 , 07:05   Re: Detect Round Time 0:00
Reply With Quote #6

...In this form plugin must work!...dunno what you mean...

EDIT:np
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Dark Killer
Senior Member
Join Date: May 2005
Location: Kowloon, Hong Kong
Old 04-11-2007 , 07:05   Re: Detect Round Time 0:00
Reply With Quote #7

oh... Sorry. Thanks!
__________________
Dark Killer is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 04-15-2007 , 12:16   Re: Detect Round Time 0:00
Reply With Quote #8

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) }

Last edited by VEN; 04-15-2007 at 12:23.
VEN is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 12-03-2007 , 08:21   Re: Detect Round Time 0:00
Reply With Quote #9

Can I make "Counter-Terrorists Win!" event instead of restarting the round? If yes, please give me the code.
hleV is offline
Old 12-05-2007, 06:29
Careface
This message has been deleted by Careface.
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 11:22.


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