AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED]Round end (https://forums.alliedmods.net/showthread.php?t=56903)

Alka 06-23-2007 19:47

[SOLVED]Round end
 
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

_Master_ 06-23-2007 20:10

Re: Round end
 
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.

Arkshine 06-23-2007 20:23

Re: Round end
 
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" );

Alka 06-23-2007 20:44

Re: Round end
 
Yeah...but in maps without objectives? :|...

djmd378 06-24-2007 01:59

Re: Round end
 
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() {     //... }

Drak 06-24-2007 02:31

Re: Round end
 
Quote:

Originally Posted by djmd378 (Post 493951)
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 (Post 493869)
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


Minimum 06-24-2007 03:12

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

This tutorial contains instructions on round-related events. Hope that helps you out.

Alka 06-24-2007 04:03

Re: Round end
 
I know that TUT lol,but not contains what i look for.

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

Thanks all .

Sylwester 06-24-2007 08:05

Re: Round end
 
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



Alka 06-24-2007 08:26

Re: Round end
 
Huh ^^ ...thanks Sylwester is working like a charm :P! :wink:


All times are GMT -4. The time now is 21:33.

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