[TF2] Is round in progress?
Hello,
for a plugin I am currently working on, I am looking for a way to detect whether or not a round is currently active (aka. the round_start event fired). Hooking the start functions works fine, but I also want to detect that when the plugin is being late-loaded - the events don't fire until the next round start. Anyway to check that? |
Re: [TF2] Is round in progress?
Side note: TF2 doesn't use the round_start and round_end events... it uses teamplay_round_start and teamplay_round_win.
Edit: Er... actually, look through theSDKTools GameRules_GetRoundState stuff. I want to say that only RoundState_RoundRunning and RoundState_Stalemate occur while a round is running. Edit 2: RoundState_Stalemate is used for both Sudden Death and Arena. Unfortunately, it may also be used for what happens when both teams lose after a Sudden Death round or if Sudden Death is disabled... I haven't tested it to find out. Although the "one team is in humiliation" length is controlled by mp_bonusroundtime... so that may be RoundState_Bonus. |
Re: [TF2] Is round in progress?
Thanks for your response.
Unfortunately, GameRules_GetRoundState doesn't appear to be working on AskPluginLoad2, it simply doesn't do anything. Example code: PHP Code:
EDIT: Just looked into my error logs, getting spammed with this: Code:
L 10/24/2014 - 20:21:01: [SM] Plugin encountered error 21: Native is not bound |
Re: [TF2] Is round in progress?
It almost sounds like SDKTools isn't loaded when this plugin's AskPluginLoad2 is being called.
...you do have an #include <sdktools> and not after an #undef REQUIRE_EXTENSIONS, right? Incidentally, you can also tell if the plugin is late loaded from AskPluginLoad2... are you checking that before calling GameRules_GetRoundState? The various GameRules_ function will probably fail if the server has no GameRules object created. |
Re: [TF2] Is round in progress?
As it seems, AskPluginLoad2 is too early for GameRules_* stuff, so I moved it into OnPluginStart and simply set a global variable if the plugin was late loaded or not.
Works now, thanks for your help! |
Re: [TF2] Is round in progress?
https://sm.alliedmods.net/api/index....=show&id=1003&
Use onmapstart for lateload. |
Re: [TF2] Is round in progress?
Quote:
PHP Code:
|
All times are GMT -4. The time now is 15:49. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.