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

Solved [CS:GO] Respawn when late join


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jezis
AlliedModders Donor
Join Date: Jul 2016
Location: Czech Republic
Old 11-07-2017 , 10:27   [CS:GO] Respawn when late join
Reply With Quote #1

Hello everyone,

I am having hard time finding any plugin, that could spawn people, even when tey join late to the game.
I have one round that takes about 20 minutes and nobody wants to wait so long.
When they die, they get normally respawned, but when join late, they cant play.


Any cvar/plugin that could handle this?

Thank you in advance.
__________________


Last edited by Jezis; 01-09-2019 at 14:47.
Jezis is offline
Send a message via ICQ to Jezis
Zeddy_god
Senior Member
Join Date: May 2015
Location: Mumbai, India
Old 11-08-2017 , 17:04   Re: [CS:GO] Respawn when late join
Reply With Quote #2

Seems like you need a simple auto - respawn command or plugin?

Try that maybe

"mp_respawn_on_death_ct" = "1"

"mp_respawn_on_death_t" = "1"
__________________
Zeddy_god is offline
Elitcky
AlliedModders Donor
Join Date: Jun 2016
Location: Antofagasta, Chile
Old 11-08-2017 , 23:00   Re: [CS:GO] Respawn when late join
Reply With Quote #3

Quote:
Originally Posted by Jezis View Post
I have one round that takes about 20 minutes and nobody wants to wait so long.
When they die, they get normally respawned, but when join late, they cant play.
Quote:
Originally Posted by Zeddy_god View Post
"mp_respawn_on_death_ct" = "1"

"mp_respawn_on_death_t" = "1"
Just looking the name of the cvars i think its not going to work... :/ i dont know if im wrong so...

PD: @Jezis do you have any Force Join team in your plugins ? can u provide "sm plugins list"
__________________

Last edited by Elitcky; 11-08-2017 at 23:02.
Elitcky is offline
Papero
Veteran Member
Join Date: Aug 2016
Location: Italy
Old 11-10-2017 , 14:03   Re: [CS:GO] Respawn when late join
Reply With Quote #4

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

#define PLUGIN_AUTHOR         "Hexah"
#define PLUGIN_VERSION        "1.0"

bool bAlreadyTeam[MAXPLAYERS+1];

#pragma semicolon 1
#pragma newdecls required

public Plugin myinfo =
{
    
name "Late-Spawn",
    
author PLUGIN_AUTHOR,
    
description "",
    
version PLUGIN_VERSION,
    
url "csitajb.it"
};

public 
void OnPluginStart()
{
    
HookEvent("player_team"Event_PlayerTeam); //Hook when player changes team
}

public 
void OnClientPutInServer(int client)
{
    if (
GetClientTime(client) <= 5.0//Dont reset the variable if the client is online more than 5 secs.
        
return;
        
    
bAlreadyTeam[client] = false;
}

public 
void Event_PlayerTeam(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));
    
    if (
bAlreadyTeam[client]) 
        return;
    
    
CreateTimer(1.0Timer_DelayRespawnGetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE); //Delay the respawn
    
bAlreadyTeam[client] = true;
}

public 
Action Timer_DelayRespawn(Handle timerany userid)
{
    
int client GetClientOfUserId(userid);
    
    if (!
client//Client isnt online anymore
        
return Plugin_Continue;
        
    
CS_RespawnPlayer(client);
    return 
Plugin_Continue;

__________________
My Plugins
SPCode


Steam: hexer504
Telegram: Hexah
Discord: Hexah#6903

If you like my work you can donate here!

Last edited by Papero; 11-10-2017 at 14:06.
Papero is offline
Jezis
AlliedModders Donor
Join Date: Jul 2016
Location: Czech Republic
Old 11-17-2017 , 14:16   Re: [CS:GO] Respawn when late join
Reply With Quote #5

Quote:
Originally Posted by Elitcky View Post
PD: @Jezis do you have any Force Join team in your plugins ? can u provide "sm plugins list"
Here you go.
Spoiler



Thanks Papero, i will try it
__________________

Jezis is offline
Send a message via ICQ to Jezis
Jezis
AlliedModders Donor
Join Date: Jul 2016
Location: Czech Republic
Old 11-21-2017 , 17:43   Re: [CS:GO] Respawn when late join
Reply With Quote #6

Quote:
Originally Posted by Jezis View Post
...Thanks Papero, i will try it
Well, its not working. No errors tho. Any other solution?
__________________

Jezis is offline
Send a message via ICQ to Jezis
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 11-22-2017 , 02:53   Re: [CS:GO] Respawn when late join
Reply With Quote #7

I haven't tested.

cvar mp_join_grace_time have max. value 30 seconds
Code:
"mp_join_grace_time" = "0.0" min. 0.000000 max. 30.000000 game replicated        - Number of seconds after round start to allow a player to join a game

But you can remove this cvar upper pound with plugin.
PHP Code:
public void OnPluginStart()
{
    
ConVar mp_join_grace_time FindConVar("mp_join_grace_time");

    if(
mp_join_grace_time != null)
    {
        
mp_join_grace_time.SetBounds(ConVarBound_Upperfalse);        
    }

After loading plugin, it should show like this
Code:
mp_join_grace_time
"mp_join_grace_time" = "0.0" min. 0.000000 game replicated                       - Number of seconds after round start to allow a player to join a game
Then you set in gamemode_casual_server.cfg your new time, ex. mp_join_grace_time 1500
__________________
Do not Private Message @me
Bacardi is offline
Allower
Senior Member
Join Date: Sep 2013
Location: SourceEngine
Old 10-14-2019 , 10:08   Re: [CS:GO] Respawn when late join
Reply With Quote #8

Quote:
Originally Posted by Bacardi View Post
I haven't tested.

cvar mp_join_grace_time have max. value 30 seconds
Code:
"mp_join_grace_time" = "0.0" min. 0.000000 max. 30.000000 game replicated        - Number of seconds after round start to allow a player to join a game

But you can remove this cvar upper pound with plugin.
PHP Code:
public void OnPluginStart()
{
    
ConVar mp_join_grace_time FindConVar("mp_join_grace_time");

    if(
mp_join_grace_time != null)
    {
        
mp_join_grace_time.SetBounds(ConVarBound_Upperfalse);        
    }

After loading plugin, it should show like this
Code:
mp_join_grace_time
"mp_join_grace_time" = "0.0" min. 0.000000 game replicated                       - Number of seconds after round start to allow a player to join a game
Then you set in gamemode_casual_server.cfg your new time, ex. mp_join_grace_time 1500
Thank you Bacardi, this works!
__________________
Allower 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 22:37.


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