Raised This Month: $51 Target: $400
 12% 

How to detect round seconds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 03-28-2017 , 17:49   How to detect round seconds
Reply With Quote #1

Is there a way to catch last 10 seconds in round?

I want to set up countdown in every round in last 10 seconds.
Krtola is offline
Send a message via Skype™ to Krtola
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 03-28-2017 , 17:53   Re: How to detect round seconds
Reply With Quote #2

you check mp_roundtime

here's plugin which does it (I mean the countdown)
https://forums.alliedmods.net/showthread.php?p=494256
check code u might find an answer
__________________
Airkish is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 03-28-2017 , 18:44   Re: How to detect round seconds
Reply With Quote #3

Copied from Alka's:

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

#define TASK_ID 1337

new bool:g_round_started
new g_roundtimeg_adv_time

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_logevent("round_start"2"1=Round_Start")
    
register_logevent("round_end"2"1=Round_End")
    
    
register_event("TextMsg""round_restart""a""2&#Game_C""2&#Game_w")
    
    
register_message(get_user_msgid("RoundTime"), "Round_Timer")
}

public 
round_start() 
{
    
g_round_started true
}

public 
round_end()
    
remove_task(TASK_ID)

public 
round_restart()
    
remove_task(TASK_ID)

public 
Round_Timer()
{
    if(
g_round_started)
        
g_round_started false
    
else
        return
    
    
g_roundtime get_msg_arg_int(1)
    
g_adv_time = (g_roundtime 11)
    
    
set_task(float(g_adv_time), "show_adv",TASK_ID)
}

public 
show_adv()
{
    
set_hudmessage(02550, -1.0, -1.016.03.0,_,_,-1)
    
show_hudmessage(0"10 Seconds until round end!")

__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 03-28-2017 at 18:44.
EFFx is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 03-29-2017 , 07:29   Re: How to detect round seconds
Reply With Quote #4

Quote:
Originally Posted by EFFx View Post
Copied from Alka's:

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

#define TASK_ID 1337

new bool:g_round_started
new g_roundtimeg_adv_time

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_logevent("round_start"2"1=Round_Start")
    
register_logevent("round_end"2"1=Round_End")
    
    
register_event("TextMsg""round_restart""a""2&#Game_C""2&#Game_w")
    
    
register_message(get_user_msgid("RoundTime"), "Round_Timer")
}

public 
round_start() 
{
    
g_round_started true
}

public 
round_end()
    
remove_task(TASK_ID)

public 
round_restart()
    
remove_task(TASK_ID)

public 
Round_Timer()
{
    if(
g_round_started)
        
g_round_started false
    
else
        return
    
    
g_roundtime get_msg_arg_int(1)
    
g_adv_time = (g_roundtime 11)
    
    
set_task(float(g_adv_time), "show_adv",TASK_ID)
}

public 
show_adv()
{
    
set_hudmessage(02550, -1.0, -1.016.03.0,_,_,-1)
    
show_hudmessage(0"10 Seconds until round end!")

This works.
Tnx.
Krtola is offline
Send a message via Skype™ to Krtola
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 17:47.


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