AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Detect roundtime 1:00 (https://forums.alliedmods.net/showthread.php?t=96062)

Rirre 06-30-2009 10:05

Detect roundtime 1:00
 
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"


hleV 06-30-2009 10:20

Re: Detect roundtime 1:00
 
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");



Rirre 06-30-2009 10:25

Re: Detect roundtime 1:00
 
Thx.
I forgot to input a command for round end also, sorry.

ConnorMcLeod 06-30-2009 10:57

Re: Detect roundtime 1:00
 
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.

hleV 06-30-2009 12:15

Re: Detect roundtime 1:00
 
Yeah, I've registered RoundEnd event but forgot to use it (for removing the task).

Rirre 06-30-2009 18:45

Re: Detect roundtime 1:00
 
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);



stupok 07-02-2009 22:08

Re: Detect roundtime 1:00
 
http://forums.alliedmods.net/showpos...26&postcount=5

sooN 07-02-2009 22:26

Re: Detect roundtime 1:00
 
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 !

ConnorMcLeod 07-03-2009 00:56

Re: Detect roundtime 1:00
 
Quote:

Originally Posted by sooN (Post 862898)
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.

sooN 07-03-2009 11:07

Re: Detect roundtime 1:00
 
How ?


All times are GMT -4. The time now is 15:28.

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