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

[CSGO] Force Ts win


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FuZ!on
Senior Member
Join Date: Aug 2007
Old 04-02-2015 , 19:55   [CSGO] Force Ts win
Reply With Quote #1

Just a simple request.

I have a map that I want the Ts to win but when time runs out, it's a draw. I'd like it to force Ts to win.

Thanks!
FuZ!on is offline
Darkness_
Veteran Member
Join Date: Nov 2014
Old 04-02-2015 , 20:23   Re: [CSGO] Force Ts win
Reply With Quote #2

https://sm.alliedmods.net/new-api/cs...TerminateRound
https://sm.alliedmods.net/new-api/cstrike/__raw

int CS_TerminateRound(float delay, CSRoundEndReason reason, bool blockhook)

PHP Code:
enum CSRoundEndReason
{
    
CSRoundEnd_TargetBombed 0,           /**< Target Successfully Bombed! */
    
CSRoundEnd_VIPEscaped,                 /**< The VIP has escaped! */
    
CSRoundEnd_VIPKilled,                  /**< VIP has been assassinated! */
    
CSRoundEnd_TerroristsEscaped,          /**< The terrorists have escaped! */
    
CSRoundEnd_CTStoppedEscape,            /**< The CTs have prevented most of the terrorists from escaping! */
    
CSRoundEnd_TerroristsStopped,          /**< Escaping terrorists have all been neutralized! */
    
CSRoundEnd_BombDefused,                /**< The bomb has been defused! */
    
CSRoundEnd_CTWin,                      /**< Counter-Terrorists Win! */
    
CSRoundEnd_TerroristWin,               /**< Terrorists Win! */
    
CSRoundEnd_Draw,                       /**< Round Draw! */
    
CSRoundEnd_HostagesRescued,            /**< All Hostages have been rescued! */
    
CSRoundEnd_TargetSaved,                /**< Target has been saved! */
    
CSRoundEnd_HostagesNotRescued,         /**< Hostages have not been rescued! */
    
CSRoundEnd_TerroristsNotEscaped,       /**< Terrorists have not escaped! */
    
CSRoundEnd_VIPNotEscaped,              /**< VIP has not escaped! */
    
CSRoundEnd_GameStart,                  /**< Game Commencing! */
    
    // The below only exist on CS:GO
    
CSRoundEnd_TerroristsSurrender,        /**< Terrorists Surrender */
    
CSRoundEnd_CTSurrender,                /**< CTs Surrender */
}; 
CS_TerminateRound(float delay, CSRoundEnd_TerroristWin, bool blockhook)
Should work.

Last edited by Darkness_; 04-02-2015 at 20:24.
Darkness_ is offline
FuZ!on
Senior Member
Join Date: Aug 2007
Old 04-02-2015 , 20:27   Re: [CSGO] Force Ts win
Reply With Quote #3

Sorry, been away from the scene for a while. And I've never worked with source mod before. Only the original AMX.

What exactly do I do with what you said? Lol.
FuZ!on is offline
secondtimesold
Senior Member
Join Date: Feb 2015
Old 04-03-2015 , 12:54   Re: [CSGO] Force Ts win
Reply With Quote #4

https://forums.alliedmods.net/showthread.php?p=2245847
secondtimesold is offline
FuZ!on
Senior Member
Join Date: Aug 2007
Old 04-16-2015 , 18:11   Re: [CSGO] Force Ts win
Reply With Quote #5

Quote:
Originally Posted by secondtimesold View Post
This doesn't really do me any good. I want each round, instead of ending in a draw, to end as a terrorist win.
FuZ!on is offline
thecount
Veteran Member
Join Date: Jul 2013
Old 04-16-2015 , 21:10   Re: [CSGO] Force Ts win
Reply With Quote #6

PHP Code:
#include <sourcemod>
#include <cstrike>

public OnPluginStart(){ HookEvent("round_end"RoundEndEventHookMode_Pre); }

public 
Action:RoundEnd(Handle:event, const String:name[], bool:dontB){
    if(
GetEventInt(event"winner") != CS_TEAM_T){
        
CS_TerminateRound(0.0CSRoundEnd_TerroristWin);
        return 
Plugin_Stop;
    }
    return 
Plugin_Continue;

This might work.
thecount is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 04-17-2015 , 04:44   Re: [CSGO] Force Ts win
Reply With Quote #7

Can't you hook the event pre, and change the event by setting the event int winner?
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-17-2015 , 16:20   Re: [CSGO] Force Ts win
Reply With Quote #8

Quote:
Originally Posted by friagram View Post
Can't you hook the event pre, and change the event by setting the event int winner?
I don't think that will change the internal scoring, though.

Having said that...

PHP Code:
#include <cstrike>

public Action:CS_OnTerminateRound(&Float:delay, &CSRoundEndReason:reason)
{
    
decl String:map[PLATFORM_MAX_PATH];
    
GetCurrentMap(mapsizeof(map));

    if (
StrEqual(map"mymapname") && reason == CSRoundEnd_Draw)
    {
        
reason CSRoundEnd_TerroristWin;
        return 
Plugin_Changed;
    }

    return 
Plugin_Continue;

should change any draws on the map named "mymapname" to Terrorist wins.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 04-17-2015 at 16:25.
Powerlord is offline
FuZ!on
Senior Member
Join Date: Aug 2007
Old 04-20-2015 , 17:26   Re: [CSGO] Force Ts win
Reply With Quote #9

I'm going to be testing this in a day or so as I'm backed up right now with other work but is there anyway to add to this then, if Ts win, they get the point and if they lose, it switches the two teams and the points stay with them? Sorta like Hide n Seek
FuZ!on is offline
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 04-20-2015 , 19:14   Re: [CSGO] Force Ts win
Reply With Quote #10

PHP Code:
mp_default_team_winner_no_objective 
Self explanatory

Last edited by Mathias.; 04-20-2015 at 19:17.
Mathias. 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 14:49.


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