Raised This Month: $ Target: $400
 0% 

Q: RoundTime


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mugwump
Senior Member
Join Date: May 2004
Old 05-13-2004 , 16:17   Q: RoundTime
Reply With Quote #1

I am working on a CS mod and trying to use this event to do some data gathering and processing. One of the variables I increment is a global round_count for keeping track of the number of rounds that has elapsed . So after dumping the data I notice this event must be getting triggered quite a bit more than just once at the beginning of a round (at least 3x-4x more), which is the way I mistakenly understood it to work using this register_event example I found from the skunkage :

register_event("RoundTime", "new_round", "bc")

I am still a newbie at scripting with AMXX so am wondering if that register_event call can be tweaked to only be called at the round start? If not, is using the TeamScore event a better way to do end of round record-keeping?

Mugwump
Mugwump is offline
ts2do
Senior Member
Join Date: Mar 2004
Old 05-13-2004 , 19:17  
Reply With Quote #2

no, if that event it the right one, then itll catch the event every time its sent
ts2do is offline
Send a message via AIM to ts2do
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 05-14-2004 , 04:09  
Reply With Quote #3

Detecting certain moments in gameplay is an interesting topic. I usually use something like this:

Code:
    register_event("ResetHUD","newround_event","b")     register_event("SendAudio","endround_event","a","2&%!MRAD_terwin","2&%!MRAD_ctwin","2&%!MRAD_rounddraw")     register_event("TextMsg","endround_event","a","2&#Game_C","2&#Game_w")     register_event("TextMsg","endround_event","a","2&#Game_will_restart_in")

Your solution might actually be better, I haven't tried it, but this way works ok. If I want to do something at the start of a new round only once, I would need to put a boolean "runThisRound" check first thing in newround_event. If its false, it will continue with newround_event and set the boolean to true, so that the next time newround_Event gets called (it will get called once for each player, even late joiners) it will just get stuck at the boolean check. The boolean is reset to false in endround_event.
I'm sure there are better ways to do this, but this has worked good so far.
Johnny got his gun is offline
Reply


Thread Tools
Display Modes

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 01:55.


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