Raised This Month: $ Target: $400
 0% 

[CSGO] Stuck at team select picture


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
abckrieger
Senior Member
Join Date: Oct 2012
Location: Germany
Old 06-29-2014 , 10:26   [CSGO] Stuck at team select picture
Reply With Quote #1

Hey,
I need for my plugin (kztimer) a modification which allows players to change their teams as often as they want. CS:GO says normally after the first team change "only 1 team change allowed". My code creates a weird bug, since one of the last csgo updates, which only appears on windows servers and in combination with bots. After selecting a team you just see the team select picture. You are already spawned at the right place but this fuckin picture doenst go away ... http://s14.directupload.net/images/140629/h6pps93v.jpg
Only solution is a round restart or if someone slays/kills you. Otherwise you have to quit your game with ctrl+alt del. Like i said before the bug only appears if a bot is on your server. I don't have any problems when bot_quota is set to 0. I've already try to bypass that by checking for human players before adding bots. But that solves the problem only for the 1st player :/

I have extracted the relevant code to make it easier for you:
Code:
#pragma semicolon 1
#include <sourcemod>
#include <cstrike>

public Plugin:myinfo =
{
    name = "bug tester",
    author = "1NutWunDeR",
    description = "",
    version = "1.0"
}

public OnPluginStart()
    AddCommandListener(Command_JoinTeam, "jointeam");

public OnMapStart()
{
    //neverending round, no warmup, add bots, respawn enabled    
    ServerCommand("mp_ignore_round_win_conditions 1;mp_do_warmup_period 0;bot_quota 1;bot_join_after_player 1;mp_respawn_on_death_ct 1;mp_respawn_on_death_t 1;mp_respawnwavetime_t 1.0;mp_respawnwavetime_ct 1.0;mp_spectators_max 30;mp_limitteams 0;mp_autoteambalance 0");
}
//unlimited team changes
public Action:Command_JoinTeam(client, const String:command[], argc) 
{ 
    if(!argc || !client || !IsValidClient(client))
        return Plugin_Handled;

    decl String:szTeam[8];
    GetCmdArg(1, szTeam, sizeof(szTeam));
    new team = StringToInt(szTeam);

    if (1 <= team <= 3) 
        ChangeClientTeam(client, team); 
    return Plugin_Handled;
}

stock bool:IsValidClient(client)
{
    if(client >= 1 && client <= MaxClients && IsValidEntity(client) && IsClientConnected(client) && IsClientInGame(client))
        return true;  
    return false;
}

public Action:CS_OnTerminateRound(&Float:delay, &CSRoundEndReason:reason)
{
    new timeleft;
    GetMapTimeLeft(timeleft);
    if (timeleft>= -1)
        return Plugin_Handled;
    return Plugin_Continue;
}
/e
p.s. i tested it with an untouched sourcemod (1.5.4-git4088 win) and on maps with enough spawnpoints on both teams ;)
Attached Files
File Type: sp Get Plugin or Get Source (testplugin.sp - 444 views - 1.4 KB)

Last edited by abckrieger; 06-29-2014 at 10:52.
abckrieger is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 06-29-2014 , 20:14   Re: [CSGO] Stuck at team select picture
Reply With Quote #2

You should return Plugin_Continue instead of Plugin_Handled at the end of the command listener for 'jointeam'.

Code:
public Action:Command_JoinTeam(client, const String:command[], argc) 
{ 
    if(!argc || !client || !IsValidClient(client))
        return Plugin_Handled;

    decl String:szTeam[8];
    GetCmdArg(1, szTeam, sizeof(szTeam));
    new team = StringToInt(szTeam);

    if (1 <= team <= 3) 
        ChangeClientTeam(client, team); 
    return Plugin_Continue;
}
Drixevel is offline
JoB2C
AlliedModders Donor
Join Date: Jan 2014
Location: France
Old 06-29-2014 , 20:23   Re: [CSGO] Stuck at team select picture
Reply With Quote #3

Quote:
Originally Posted by r3dw3r3w0lf View Post
You should return Plugin_Continue instead of Plugin_Handled at the end of the command listener for 'jointeam'.

Code:
public Action:Command_JoinTeam(client, const String:command[], argc) 
{ 
    if(!argc || !client || !IsValidClient(client))
        return Plugin_Handled;

    decl String:szTeam[8];
    GetCmdArg(1, szTeam, sizeof(szTeam));
    new team = StringToInt(szTeam);

    if (1 <= team <= 3) 
        ChangeClientTeam(client, team); 
    return Plugin_Continue;
}
Eh, no.

You should return Plugin_Handled. Returning Plugin_Continue will let the engine handle the teamchange while the change is already done.

Try using CS_SwitchTeam and CS_RespawnPlayer instead of ChangeClientTeam.

Last edited by JoB2C; 06-29-2014 at 20:45.
JoB2C is offline
abckrieger
Senior Member
Join Date: Oct 2012
Location: Germany
Old 06-29-2014 , 20:40   Re: [CSGO] Stuck at team select picture
Reply With Quote #4

Quote:
Originally Posted by JoB2C View Post
Eh, no.

Returning Plugin_Continue will let the engine handle the teamchange while the change is already done.

Try using CS_SwitchTeam and CS_RespawnPlayer instead of ChangeClientTeam.
oh yea sry copy paste mistake. im using plugin_handled and it doesnt make any difference.
but thx i will try the other thing

/
it's workin now, thx

Last edited by abckrieger; 06-29-2014 at 23:10.
abckrieger is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 07-01-2014 , 08:41   Re: [CSGO] Stuck at team select picture
Reply With Quote #5

try to delay manual team change
__________________
zipcore is offline
winniethepooh
SourceMod Donor
Join Date: Sep 2012
Old 07-01-2014 , 21:29   Re: [CSGO] Stuck at team select picture
Reply With Quote #6

This may have been a CS:GO bug and fixed in today's 1.34.0.0 update.

There were a couple people on the csgo_servers mailing list that reported it too.

Quote:
Fixed the team select screen lingering and sometimes not going away in some circumstances
winniethepooh is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 07-02-2014 , 04:27   Re: [CSGO] Stuck at team select picture
Reply With Quote #7

Quote:
Originally Posted by JoB2C View Post
Eh, no.

You should return Plugin_Handled. Returning Plugin_Continue will let the engine handle the teamchange while the change is already done.

Try using CS_SwitchTeam and CS_RespawnPlayer instead of ChangeClientTeam.
If you call plugin_handled, the screen will not switch so..
Drixevel is offline
JoB2C
AlliedModders Donor
Join Date: Jan 2014
Location: France
Old 07-03-2014 , 05:27   Re: [CSGO] Stuck at team select picture
Reply With Quote #8

I'm returning Plugin_Handled in a plugin, and it does switch when you change the team with CS_SwitchTeam.

Last edited by JoB2C; 07-03-2014 at 05:29.
JoB2C is offline
hamilton5
Veteran Member
Join Date: Oct 2012
Location: USA
Old 07-03-2014 , 08:10   Re: [CSGO] Stuck at team select picture
Reply With Quote #9

post #6

7/1/2014

[misc]
-Fixed the team select screen lingering and sometimes not going away in some circumstances.

Last edited by hamilton5; 07-03-2014 at 08:17.
hamilton5 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 21:41.


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