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

[CS:GO] not able to handle / stop CS_OnTerminateRound?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kinsi
Senior Member
Join Date: Apr 2013
Old 11-14-2016 , 11:51   [CS:GO] not able to handle / stop CS_OnTerminateRound?
Reply With Quote #1

Hey,

I am currently trying to Handle / Stop the Round end Reason CSRoundEnd_TargetSaved (11). The Problem i face doing this is that even when i do handle it, it will be called again, and again, and again.

Each time its called the CT's points are counted up until the game ends because the CT's have accumulated enough points. I have tried the latest Dev and Stable build (Windows) and could just not find a fix for it. Having a non-empty CT team does not fix it either.

I do not have any other plugins on the server which could be the cause for this.

Obligatory code:

PHP Code:
public Action CS_OnTerminateRound(float &delayCSRoundEndReason &reason) {
    
PrintToChatAll("CS_OnTerminateRound.Debug: Reason? %d"reason);
    
    if(
reason == CSRoundEnd_TargetSaved) return Plugin_Stop;


     return 
Plugin_Continue;

Output:
Code:
CS_OnTerminateRound.Debug: Reason? 11
CS_OnTerminateRound.Debug: Reason? 11
CS_OnTerminateRound.Debug: Reason? 11
CS_OnTerminateRound.Debug: Reason? 11
CS_OnTerminateRound.Debug: Reason? 11
CS_OnTerminateRound.Debug: Reason? 11
CS_OnTerminateRound.Debug: Reason? 11
CS_OnTerminateRound.Debug: Reason? 11
After that the game just ends ( CT's won with a score of 8 )
Kinsi is offline
OSWO
Senior Member
Join Date: Jul 2015
Location: United Kingdom, London
Old 11-14-2016 , 12:37   Re: [CS:GO] not able to handle / stop CS_OnTerminateRound?
Reply With Quote #2

Try using Plugin_Handled
__________________
SourceTimer | WeaponSkins++ | BasePlugins++ https://github.com/OSCAR-WOS

Last edited by OSWO; 11-14-2016 at 12:38.
OSWO is offline
Kinsi
Senior Member
Join Date: Apr 2013
Old 11-14-2016 , 12:41   Re: [CS:GO] not able to handle / stop CS_OnTerminateRound?
Reply With Quote #3

Already tried that, didnt work either.
Kinsi is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 11-14-2016 , 12:48   Re: [CS:GO] not able to handle / stop CS_OnTerminateRound?
Reply With Quote #4

Did you register the event with EventHookMode_Pre?
__________________
hleV is offline
OSWO
Senior Member
Join Date: Jul 2015
Location: United Kingdom, London
Old 11-14-2016 , 12:49   Re: [CS:GO] not able to handle / stop CS_OnTerminateRound?
Reply With Quote #5

Quote:
Originally Posted by hleV View Post
Did you register the event with EventHookMode_Pre?
You don't have to. It's a global forward called. That's why it's CS_

Buddy you're gonna have to explain exactly what you're doing and why you're blocking that action for me to help you.
__________________
SourceTimer | WeaponSkins++ | BasePlugins++ https://github.com/OSCAR-WOS

Last edited by OSWO; 11-14-2016 at 12:50.
OSWO is offline
Kinsi
Senior Member
Join Date: Apr 2013
Old 11-14-2016 , 12:58   Re: [CS:GO] not able to handle / stop CS_OnTerminateRound?
Reply With Quote #6

Well i at least found a "fix".

Looks like CSGO is retarded and re-calls this even once per tick when i handle it because the round time is at 0. So i have to handle it, and up the m_iRoundTime to stop it from calling.

A leftover issue from this is that the ct's get a point added to their score which i manually have to subtract afterwards.

I am trying to force the bomb plant when the time runs out. Time runs out => whoever has the bomb is forced to plant it now with some trickery, which works.

If there is a better solution to this ill happily take it.
Kinsi is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 11-16-2016 , 18:46   Re: [CS:GO] not able to handle / stop CS_OnTerminateRound?
Reply With Quote #7

As far as I can remember from when I looked previously is that for each condition there is a function call that does stuff and then calls terminate round. Sadly the only way to fix your issue or avoid doing all this work is to detour the other function the one before terminate round.
Dr!fter is offline
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:30.


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