Raised This Month: $32 Target: $400
 8% 

CSGO Rescue all hostages?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Austin
Senior Member
Join Date: Oct 2005
Old 08-22-2021 , 05:48   CSGO Rescue all hostages?
Reply With Quote #1

Has anyone worked on a plugin that would set the number of hostages to rescue in CSGO instead of rescuing just one?
Austin is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 08-23-2021 , 04:03   Re: CSGO Rescue all hostages?
Reply With Quote #2

PHP Code:

#include <sourcemod>
#include <sdktools>
#include <cstrike>

ConVar g_Cvar_RoundRestartDelay;
ConVar g_Cvar_HostagesRescue;

int g_HostagesRescued;

public 
void OnPluginStart()
{
    
HookEvent("round_start"Event_RoundStart);
    
HookEvent("hostage_rescued"Event_HostageRescued);
    
    
g_Cvar_RoundRestartDelay FindConVar("mp_round_restart_delay");
    
g_Cvar_HostagesRescue CreateConVar("sm_hostages_rescue""2""Minimum hostages to rescue."FCVAR_NONEtrue0.0);
}

public 
void OnMapEnd()
{
    
g_HostagesRescued 0;
}

public 
void Event_RoundStart(Event event, const char[] namebool dontBroadcast)
{
    
g_HostagesRescued 0;
}

public 
void Event_HostageRescued(Event event, const char[] namebool dontBroadcast)
{
    
g_HostagesRescued++;
    if (
g_HostagesRescued >= g_Cvar_HostagesRescue.IntValue && !IsRoundEnding())
    {
        
CS_TerminateRound(g_Cvar_RoundRestartDelay g_Cvar_RoundRestartDelay.FloatValue 3.0CSRoundEnd_HostagesRescuedtrue);
    }
}

public 
Action CS_OnTerminateRound(floatdelayCSRoundEndReasonreason)
{
    if (
reason == CSRoundEnd_HostagesRescued)
    {
        
DecreaseTeamScore(CS_TEAM_CT);
        return 
Plugin_Handled;
    }
    
    return 
Plugin_Continue;
}

void DecreaseTeamScore(int team)
{
    
int score CS_GetTeamScore(team) - 1;
    
CS_SetTeamScore(teamscore);
    
SetTeamScore(teamscore);
}

bool IsRoundEnding()
{
    return 
GameRules_GetProp("m_iRoundWinStatus") > 0;

__________________

Last edited by Ilusion9; 08-23-2021 at 05:06.
Ilusion9 is offline
Austin
Senior Member
Join Date: Oct 2005
Old 08-23-2021 , 05:59   Re: CSGO Rescue all hostages?
Reply With Quote #3

It works!
I tried it on Italy setting to rescue 1 or 2 and it works fine.

More info for anyone who is interested.

There is this setting in CSGO to set the number of hostage in the map.
mp_hostages_max

I tried setting this to 3 but still only got 2 hostages (in cs_italy).
mp_hostages_max 3

I assumed it had to do with the number of hostage entities in the map and VD verifies this
https://developer.valvesoftware.com/wiki/Hostage_entity
mp_hostages_max 2 - Maximum number of hostages to spawn. The number of hostages cannot exceed the number of hostage entities on the map.

But Italy has only ONE hostage_entity and will spawn TWO hostages but not three…

The number of hostages max you can have in a map seems to be controlled by the number of info_hostage_spawn “groups” you have.

To get three hostages in Italy I used stripper to add in another group and it does give three hostages and your code works setting sm_hostages_rescue to 1, 2 or 3

These setting will set up italy to force rescuing three hostages.

mp_hostages_max 3
sm_hostages_rescue 3

cs_italy.cfg (stripper config)
// add in another spawn group3 to make it possible to get up to three hostages in the map
add:
{
"origin" "202 2174 70"
"HostageSpawnRandomFactor" "1"
"HostageSpawnExclusionGroup3" "1"
"angles" "0 45 0"
"classname" "info_hostage_spawn"
"hammerid" "5490563"
}
{
"origin" "557 2512 128"
"HostageSpawnRandomFactor" "1"
"HostageSpawnExclusionGroup3" "1"
"angles" "0 45 0"
"classname" "info_hostage_spawn"
"hammerid" "5490563"
}

Excellent!
Thanks!

Last edited by Austin; 08-23-2021 at 06:59.
Austin is offline
Ark_Procession
Senior Member
Join Date: Jun 2020
Location: Argentina
Old 11-01-2021 , 12:59   Re: CSGO Rescue all hostages?
Reply With Quote #4

Quote:
Originally Posted by Austin View Post
It works!
I tried it on Italy setting to rescue 1 or 2 and it works fine.

More info for anyone who is interested.

There is this setting in CSGO to set the number of hostage in the map.
mp_hostages_max

I tried setting this to 3 but still only got 2 hostages (in cs_italy).
mp_hostages_max 3

I assumed it had to do with the number of hostage entities in the map and VD verifies this
https://developer.valvesoftware.com/wiki/Hostage_entity
mp_hostages_max 2 - Maximum number of hostages to spawn. The number of hostages cannot exceed the number of hostage entities on the map.

But Italy has only ONE hostage_entity and will spawn TWO hostages but not three…

The number of hostages max you can have in a map seems to be controlled by the number of info_hostage_spawn “groups” you have.

To get three hostages in Italy I used stripper to add in another group and it does give three hostages and your code works setting sm_hostages_rescue to 1, 2 or 3

These setting will set up italy to force rescuing three hostages.

mp_hostages_max 3
sm_hostages_rescue 3

cs_italy.cfg (stripper config)
// add in another spawn group3 to make it possible to get up to three hostages in the map
add:
{
"origin" "202 2174 70"
"HostageSpawnRandomFactor" "1"
"HostageSpawnExclusionGroup3" "1"
"angles" "0 45 0"
"classname" "info_hostage_spawn"
"hammerid" "5490563"
}
{
"origin" "557 2512 128"
"HostageSpawnRandomFactor" "1"
"HostageSpawnExclusionGroup3" "1"
"angles" "0 45 0"
"classname" "info_hostage_spawn"
"hammerid" "5490563"
}

Excellent!
Thanks!
i recall it working at least once but now i cant get this to work. i am in cs go.
Ark_Procession is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 11-01-2021 , 13:49   Re: CSGO Rescue all hostages?
Reply With Quote #5

Code:
"mp_hostages_rescuetowin" = "1"
FCVAR_DEVELOPMENTONLY FCVAR_GAMEDLL FCVAR_REPLICATED 
- 0 == all alive, any other number is the number the CT's need to rescue to win the round.
__________________
Do not Private Message @me
Bacardi is offline
Ark_Procession
Senior Member
Join Date: Jun 2020
Location: Argentina
Old 11-01-2021 , 21:17   Re: CSGO Rescue all hostages?
Reply With Quote #6

Quote:
Originally Posted by Bacardi View Post
Code:
"mp_hostages_rescuetowin" = "1"
FCVAR_DEVELOPMENTONLY FCVAR_GAMEDLL FCVAR_REPLICATED 
- 0 == all alive, any other number is the number the CT's need to rescue to win the round.
Hello Bacardi! using sm_cvar mp_hostages_rescuetowin 2 works perfectly!

Thanks a lot!!!!

Last edited by Ark_Procession; 11-01-2021 at 21:39.
Ark_Procession is offline
Austin
Senior Member
Join Date: Oct 2005
Old 04-02-2022 , 01:55   Re: CSGO Rescue all hostages?
Reply With Quote #7

mp_hostages_rescuetowin
I am not finding this and setting it has no effect on my server.
??

] mp_hostages_rescuetowin
Unknown command: mp_hostages_rescuetowin

] find mp_hostages_rescuetowin
Austin is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-02-2022 , 02:27   Re: CSGO Rescue all hostages?
Reply With Quote #8

Quote:
Originally Posted by Austin View Post
mp_hostages_rescuetowin
I am not finding this and setting it has no effect on my server.
??

] mp_hostages_rescuetowin
Unknown command: mp_hostages_rescuetowin

] find mp_hostages_rescuetowin
It is hidden cvar.
You can change cvar value by using sm_cvar

Code:
find mp_hostages_rescuetowin
help mp_hostages_rescuetowin
"mp_hostages_rescuetowin" = "1" game replicated                                  - 0 == all alive, any other number is the number the CT's need to rescue to win th
mp_hostages_rescuetowin 0
Unknown command "mp_hostages_rescuetowin"
sm_cvar mp_hostages_rescuetowin 0
[SM] Changed cvar "mp_hostages_rescuetowin" to "0".
L 04/02/2022 - 09:27:02: [basecommands.smx] "Console<0><Console><Console>" changed cvar (cvar "mp_hostages_rescuetowin") (value "0")
__________________
Do not Private Message @me

Last edited by Bacardi; 04-02-2022 at 02:29.
Bacardi is offline
Austin
Senior Member
Join Date: Oct 2005
Old 04-03-2022 , 18:13   Re: CSGO Rescue all hostages?
Reply With Quote #9

I am always interested in the HOW.

Bacardi,
1) HOW did you find this "hidden" cvar?
2) how do I get a list of all hidden cvars?

Manny MANNY thanks for this!
FINALLY I can play CS maps on CSGO like CS was meant to be played!

Bacardi ? genious, no : Yes!

Last edited by Austin; 04-03-2022 at 19:13.
Austin is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-04-2022 , 03:44   Re: CSGO Rescue all hostages?
Reply With Quote #10

Quote:
Originally Posted by Austin View Post
I am always interested in the HOW.

Bacardi,
1) HOW did you find this "hidden" cvar?
2) how do I get a list of all hidden cvars?

Manny MANNY thanks for this!
FINALLY I can play CS maps on CSGO like CS was meant to be played!

Bacardi ? genious, no : Yes!
I have read forum posts, I'm not actually found it. Then there are plugins which list convars and commands.
Second is by try find console variable using "find" and "help" command.
__________________
Do not Private Message @me

Last edited by Bacardi; 04-04-2022 at 03:45.
Bacardi 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 04:57.


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