Raised This Month: $ Target: $400
 0% 

Detect roundtime 1:00


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rirre
Veteran Member
Join Date: Nov 2006
Old 06-30-2009 , 10:05   Detect roundtime 1:00
Reply With Quote #1

Ok, i have search Around whole AMX Mod X forum now and still can't find any help.
I want when the round time is 1 minute left so will it execute on the server console to all alive players.
PHP Code:
server_cmd("command"

Last edited by Rirre; 06-30-2009 at 10:09.
Rirre is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-30-2009 , 10:20   Re: Detect roundtime 1:00
Reply With Quote #2

Try this.
PHP Code:
#include <amxmodx>
 
new RoundTime;
 
public 
plugin_init()
{
        
register_plugin("Detect Round Time""1.0""hleV");
 
        
register_logevent("RoundStart"2"1=Round_Start");
        
register_logevent("RoundEnd"2"1=Round_End");
 
        
RoundTime get_cvar_pointer("mp_roundtime");
}
 
public 
RoundStart()
        
set_task(get_pcvar_float(RoundTime) - 60.0"Execute"123);
 
public 
RoundEnd()
        
remove_task(123);
 
public 
Execute()
{
        
// Execute command for all players
        
client_cmd(0"yourcommand");
 
        
// Execute command for server
        
server_cmd("yourcommand");

__________________

Last edited by hleV; 06-30-2009 at 12:15.
hleV is offline
Rirre
Veteran Member
Join Date: Nov 2006
Old 06-30-2009 , 10:25   Re: Detect roundtime 1:00
Reply With Quote #3

Thx.
I forgot to input a command for round end also, sorry.
Rirre is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-30-2009 , 10:57   Re: Detect roundtime 1:00
Reply With Quote #4

Add a specific id to the task, so you can use remove_task(Task_Id) at round end.
Also, this will not detect bomb planting.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-30-2009 , 12:15   Re: Detect roundtime 1:00
Reply With Quote #5

Yeah, I've registered RoundEnd event but forgot to use it (for removing the task).
__________________
hleV is offline
Rirre
Veteran Member
Join Date: Nov 2006
Old 06-30-2009 , 18:45   Re: Detect roundtime 1:00
Reply With Quote #6

EDIT: It doesn't work correcly :/
When i joined the game so did the server execute the command.

Will this work?
PHP Code:
public RoundEnd()
{
    
server_cmd("yourcommand");
        
remove_task(123);


Last edited by Rirre; 06-30-2009 at 18:51.
Rirre is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 07-02-2009 , 22:08   Re: Detect roundtime 1:00
Reply With Quote #7

http://forums.alliedmods.net/showpos...26&postcount=5
__________________
stupok is offline
sooN
Veteran Member
Join Date: Apr 2009
Old 07-02-2009 , 22:26   Re: Detect roundtime 1:00
Reply With Quote #8

Hello, i need a same plugin but if roundtime is 0:00 i execute "...", i can not detect the end of round because my map don't have an objective ( hostage, bomb etc..). and when roundtime is a 0 : 00 ct win !
__________________

Last edited by sooN; 07-02-2009 at 23:02.
sooN is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-03-2009 , 00:56   Re: Detect roundtime 1:00
Reply With Quote #9

Quote:
Originally Posted by sooN View Post
Hello, i need a same plugin but if roundtime is 0:00 i execute "...", i can not detect the end of round because my map don't have an objective ( hostage, bomb etc..). and when roundtime is a 0 : 00 ct win !
As an alternative you can put an unreachable bombsite.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
sooN
Veteran Member
Join Date: Apr 2009
Old 07-03-2009 , 11:07   Re: Detect roundtime 1:00
Reply With Quote #10

How ?
__________________
sooN 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 15:28.


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