AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Solved [CS:GO] Respawn when late join (https://forums.alliedmods.net/showthread.php?t=302687)

Jezis 11-07-2017 10:27

[CS:GO] Respawn when late join
 
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.

Zeddy_god 11-08-2017 17:04

Re: [CS:GO] Respawn when late join
 
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"

Elitcky 11-08-2017 23:00

Re: [CS:GO] Respawn when late join
 
Quote:

Originally Posted by Jezis (Post 2559066)
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 (Post 2559288)
"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"

Papero 11-10-2017 14:03

Re: [CS:GO] Respawn when late join
 
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;



Jezis 11-17-2017 14:16

Re: [CS:GO] Respawn when late join
 
Quote:

Originally Posted by Elitcky (Post 2559330)
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 11-21-2017 17:43

Re: [CS:GO] Respawn when late join
 
Quote:

Originally Posted by Jezis (Post 2561063)
...Thanks Papero, i will try it :)

Well, its not working. No errors tho. Any other solution?

Bacardi 11-22-2017 02:53

Re: [CS:GO] Respawn when late join
 
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

Allower 10-14-2019 10:08

Re: [CS:GO] Respawn when late join
 
Quote:

Originally Posted by Bacardi (Post 2562112)
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!


All times are GMT -4. The time now is 23:49.

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