This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Global new round?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 10-23-2004 , 13:07   Global new round?
Reply With Quote #1

How do I have a function called once on a new round?

I know how to do this, but I'd like to use register_event, is this possible?
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Da Bishop
Senior Member
Join Date: Aug 2004
Location: Chester County PA
Old 10-23-2004 , 14:15  
Reply With Quote #2

maybe something like this

Code:
register_event( "RoundTime", "round_check", "a") iRoundTime = read_data( 1 ); if ( iRoundTime >= get_cvar_float("mp_roundtime") * 60 ) {
Da Bishop is offline
Send a message via MSN to Da Bishop
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 10-23-2004 , 20:01  
Reply With Quote #3

yes but how often is RoundTime going to be called? a lot?
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
DS
SourceMod Developer
Join Date: Sep 2004
Location: WI, USA
Old 10-23-2004 , 22:00  
Reply With Quote #4

The a flag won't work in this case because RoundTime is sent to every player on an individual basis. So try this...

Code:
public plugin_init() {     register_event("RoundTime", "round_start", "bc") } public round_start() {     if (read_data(1) == floatround(get_cvar_float("mp_roundtime") * 60.0)) {         // Code called one time at start of round     }         return PLUGIN_CONTINUE }
DS is offline
Da Bishop
Senior Member
Join Date: Aug 2004
Location: Chester County PA
Old 10-23-2004 , 22:36  
Reply With Quote #5

o yes sry - yes the roundtime will be called a lot but it won't procede unless (lets say u have 20 min rounds ) there is 20 mins left in the round.
Da Bishop is offline
Send a message via MSN to Da Bishop
Macelarul
Junior Member
Join Date: Jul 2004
Old 10-28-2004 , 16:40  
Reply With Quote #6

try to register the event "TeamScore" I saw that it is run at round start. Check and tell me if it's what you seeked
Macelarul is offline
Send a message via Yahoo to Macelarul
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 10:01.


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