AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   General (https://forums.alliedmods.net/forumdisplay.php?f=58)
-   -   [CS:GO] Solid spectators (https://forums.alliedmods.net/showthread.php?t=318952)

eyal282 10-02-2019 04:17

[CS:GO] Solid spectators
 
For some reason spectators on my server will occasionally turn solid, making the spectated player unable to press E on buttons, shoot and hit targets or be shot. Bug is too random to start removing plugins to track it. Ideas?

Franc1sco 10-02-2019 05:45

Re: [CS:GO] Solid spectators
 
This usually occur when you respawn spectators. Some plugins dont have a "if condition" for prevent respawn spectators when you use something like !respawn @all

Also i think that this bug occur too when you switch a player to spectator without kill him before.

eyal282 10-10-2019 13:35

Re: [CS:GO] Solid spectators
 
Quote:

Originally Posted by Franc1sco (Post 2668560)
This usually occur when you respawn spectators. Some plugins dont have a "if condition" for prevent respawn spectators when you use something like !respawn @all

Also i think that this bug occur too when you switch a player to spectator without kill him before.


Doesn't work, an unassigned team player is moved into spectator via ClientCommand(client, "jointeam %i", CS_TEAM_SPECTATOR); and once the round starts and he locks into a player, the nightmare happens again.

Lubricant Jam 10-10-2019 19:38

Re: [CS:GO] Solid spectators
 
The way I sorted it was checked if their team was spectator on spawn and simply disabled collisions for them.

e54385991 10-11-2019 04:34

Re: [CS:GO] Solid spectators
 
PHP Code:

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

int g_offsCollisionGroup;

public 
void OnPluginStart()
{
    
g_offsCollisionGroup FindSendPropInfo("CBaseEntity""m_CollisionGroup");
    
HookEvent("player_team"Event_TeamEventHookMode_Pre);
}

public 
Action Event_Team(Event event, const char[] namebool dontBroadcast)
{
    
int userid event.GetInt("userid");
    
int client GetClientOfUserId(userid);
    if(!
client || !IsClientInGame(client))
        return 
Plugin_Continue;
    
int iNewTeam event.GetInt("team");

    if(
iNewTeam != CS_TEAM_T && iNewTeam != CS_TEAM_CT)
    {
        
CreateTimer(0.0Timer_Postuserid);
    }

    return 
Plugin_Continue;
}

public 
Action Timer_Post(Handle timerint userid)
{
    
int client GetClientOfUserId(userid);
    if(
client <=|| !IsClientInGame(client))
        return 
Plugin_Continue;
    
int iTeam GetClientTeam(client);

    if(
iTeam == CS_TEAM_T || iTeam == CS_TEAM_CT)
        return 
Plugin_Continue;

    
SetEntData(clientg_offsCollisionGroup24true);

    return 
Plugin_Continue;


no test

eyal282 10-11-2019 10:32

Re: [CS:GO] Solid spectators
 
Quote:

Originally Posted by e54385991 (Post 2669473)
PHP Code:

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

int g_offsCollisionGroup;

public 
void OnPluginStart()
{
    
g_offsCollisionGroup FindSendPropInfo("CBaseEntity""m_CollisionGroup");
    
HookEvent("player_team"Event_TeamEventHookMode_Pre);
}

public 
Action Event_Team(Event event, const char[] namebool dontBroadcast)
{
    
int userid event.GetInt("userid");
    
int client GetClientOfUserId(userid);
    if(!
client || !IsClientInGame(client))
        return 
Plugin_Continue;
    
int iNewTeam event.GetInt("team");

    if(
iNewTeam != CS_TEAM_T && iNewTeam != CS_TEAM_CT)
    {
        
CreateTimer(0.0Timer_Postuserid);
    }

    return 
Plugin_Continue;
}

public 
Action Timer_Post(Handle timerint userid)
{
    
int client GetClientOfUserId(userid);
    if(
client <=|| !IsClientInGame(client))
        return 
Plugin_Continue;
    
int iTeam GetClientTeam(client);

    if(
iTeam == CS_TEAM_T || iTeam == CS_TEAM_CT)
        return 
Plugin_Continue;

    
SetEntData(clientg_offsCollisionGroup24true);

    return 
Plugin_Continue;


no test

I didn't test this but this is guaranteed not to work for two reasons:

1. Spectators show up as enemies so it's still annoying to see the "enemy" marker which shows a name without having an enemy

2. Solidity of a player doesn't affect collision of bullets. I tried it in my AS gamemode plugin and confirmed it. The problem is that the spectator is alive.

eyal282 11-01-2019 17:45

Re: [CS:GO] Solid spectators
 
Update: I discovered the spectators are capable of affecting trigger_multiple entities when the bug is affecting them.

Syoudous 11-01-2019 23:56

Re: [CS:GO] Solid spectators
 
I think you asked this on Discord and I replied to you once before. Just a guess though,

Code:

ForcePlayerSuicide(client);
ChangeClientTeam(client, 1);

If you do anything similar to that in CS:GO then players will be solid while in spectate. Doing...


Code:

ChangeClientTeam(client, 1);
...alone is enough. AFKManager4 has (had?) this issue. Maybe someone could clarify more in detail why this happens.

eyal282 04-09-2020 08:14

Re: [CS:GO] Solid spectators
 
Quote:

Originally Posted by Syoudous (Post 2671674)
I think you asked this on Discord and I replied to you once before. Just a guess though,

Code:

ForcePlayerSuicide(client);
ChangeClientTeam(client, 1);

If you do anything similar to that in CS:GO then players will be solid while in spectate. Doing...


Code:

ChangeClientTeam(client, 1);
...alone is enough. AFKManager4 has (had?) this issue. Maybe someone could clarify more in detail why this happens.

Unfortunately this happens actually even if I press M to change my team to spectator. This is possibly by a plugin but because it's so random, I need a workaround rather than a definite fix.

Bacardi 04-09-2020 09:13

Re: [CS:GO] Solid spectators
 
Check any plugin, not give/equip weapon to spectators, team 0 or dead players.
Not change any health value either.

*edit
Not sure, is dead player able to interfier buy menu in buy zone?
Can't open menu but health bar appeared. I had wierd thing happened, can't remember was it on warmup or in match.


All times are GMT -4. The time now is 06:09.

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