Raised This Month: $ Target: $400
 0% 

[SOLVED]Round end


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 06-23-2007 , 19:47   [SOLVED]Round end
Reply With Quote #1

Hi.I want to detect when the round is end but without "register_logevent". I want to detect it when "round timer" equal with 0,and make stuffs!

I tried something like this but is not working!
Code:
public plugin_init()
{
...
register_event("RoundTime", "Round_Time", "bc")
...
}
 
public Round_Time()
{
 new rnd_time = read_data(1) 
 
         if ( rnd_time <= 0)
         {
                  //stufs
         }
}
Thanks
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 06-24-2007 at 09:59.
Alka is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 06-23-2007 , 20:10   Re: Round end
Reply With Quote #2

RoundTime is fired at start of freezetime with the value of mp_freezetime
At the end of freezetime it's fired again with the value of mp_roundtime. Both values are in seconds and always pozitive.

You cannot use this tho because the round could end before roundtime expires.
_Master_ is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-23-2007 , 20:23   Re: Round end
Reply With Quote #3

To hook round end with an event, you can use something like too, I believe :
Code:
register_event( "SendAudio",  "endround",  "a",  "2&%!MRAD_terwin",  "2&%!MRAD_ctwin",  "2&%!MRAD_rounddraw" );
__________________
Arkshine is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 06-23-2007 , 20:44   Re: Round end
Reply With Quote #4

Yeah...but in maps without objectives? ...
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
djmd378
Senior Member
Join Date: Sep 2004
Old 06-24-2007 , 01:59   Re: Round end
Reply With Quote #5

Something like this?

Code:
//...     register_logevent("logevent_round_start", 2, "1=Round_Start")   //... public logevent_round_start() set_task(get_cvar_float("mp_roundtime"), "round_end") public round_end() {     //... }
__________________
djmd378 is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 06-24-2007 , 02:31   Re: Round end
Reply With Quote #6

Quote:
Originally Posted by djmd378 View Post
Something like this?

Code:
//...     register_logevent("logevent_round_start", 2, "1=Round_Start")   //... public logevent_round_start() set_task(get_cvar_float("mp_roundtime"), "round_end") public round_end() {     //... }
Quote:
Originally Posted by Alka View Post
Hi.I want to detect when the round is end but without "register_logevent". I want to detect it when "round timer" equal with 0,and make stuffs!

Thanks
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
Minimum
Senior Member
Join Date: Jun 2006
Old 06-24-2007 , 03:12   Re: Round end
Reply With Quote #7

http://forums.alliedmods.net/showthread.php?t=42159

This tutorial contains instructions on round-related events. Hope that helps you out.
Minimum is offline
Send a message via AIM to Minimum Send a message via MSN to Minimum
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 06-24-2007 , 04:03   Re: Round end
Reply With Quote #8

I know that TUT lol,but not contains what i look for.

@djmd378 - I tried that but round is ending much sooner!

Thanks all .
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 06-24-2007 , 08:05   Re: Round end
Reply With Quote #9

try this:
PHP Code:
#include <amxmodx>
new bool:g_round_started
new g_roundtime

public plugin_init(){
    
register_plugin"test2""1.0""Sylwester" )
    
register_logevent("logevent_round_start"2"1=Round_Start")
    
register_message(get_user_msgid("RoundTime"), "round_time")
}


public 
logevent_round_start(){
    
g_round_started true
}

public 
round_time(){
    if(
g_round_started)
        
g_round_started false
    
else return

    
g_roundtime get_msg_arg_int(1)
    
set_task(float(g_roundtime), "my_func")
}

public 
my_func(){
    
// DO STUFF

__________________
Impossible is Nothing
Sylwester is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 06-24-2007 , 08:26   Re: Round end
Reply With Quote #10

Huh ^^ ...thanks Sylwester is working like a charm !
__________________
Still...lovin' . Connor noob! Hello
Alka 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 21:33.


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