Raised This Month: $51 Target: $400
 12% 

[CS:GO] Solid spectators


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eyal282
Veteran Member
Join Date: Aug 2011
Old 10-02-2019 , 04:17   [CS:GO] Solid spectators
Reply With Quote #1

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?
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 10-02-2019 , 05:45   Re: [CS:GO] Solid spectators
Reply With Quote #2

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.
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.


Last edited by Franc1sco; 10-02-2019 at 05:50.
Franc1sco is offline
Send a message via MSN to Franc1sco
eyal282
Veteran Member
Join Date: Aug 2011
Old 10-10-2019 , 13:35   Re: [CS:GO] Solid spectators
Reply With Quote #3

Quote:
Originally Posted by Franc1sco View Post
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.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Lubricant Jam
AlliedModders Donor
Join Date: Oct 2016
Location: United Kingdom
Old 10-10-2019 , 19:38   Re: [CS:GO] Solid spectators
Reply With Quote #4

The way I sorted it was checked if their team was spectator on spawn and simply disabled collisions for them.
__________________
Lubricant Jam is offline
e54385991
AlliedModders Donor
Join Date: Aug 2013
Old 10-11-2019 , 04:34   Re: [CS:GO] Solid spectators
Reply With Quote #5

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
__________________
e54385991 is offline
Send a message via ICQ to e54385991
eyal282
Veteran Member
Join Date: Aug 2011
Old 10-11-2019 , 10:32   Re: [CS:GO] Solid spectators
Reply With Quote #6

Quote:
Originally Posted by e54385991 View Post
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.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 11-01-2019 , 17:45   Re: [CS:GO] Solid spectators
Reply With Quote #7

Update: I discovered the spectators are capable of affecting trigger_multiple entities when the bug is affecting them.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Syoudous
Junior Member
Join Date: Feb 2013
Old 11-01-2019 , 23:56   Re: [CS:GO] Solid spectators
Reply With Quote #8

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.
Syoudous is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 04-09-2020 , 08:14   Re: [CS:GO] Solid spectators
Reply With Quote #9

Quote:
Originally Posted by Syoudous View Post
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.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-09-2020 , 09:13   Re: [CS:GO] Solid spectators
Reply With Quote #10

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.
__________________
Do not Private Message @me

Last edited by Bacardi; 04-09-2020 at 09:17.
Bacardi 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 06:47.


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