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

[CS:GO/CS:S] Admin Stealth


Post New Thread Reply   
 
Thread Tools Display Modes
lay295
Senior Member
Join Date: Sep 2013
Old 04-23-2017 , 17:43   Re: [CS:GO/CS:S] Simple Stealth v1
Reply With Quote #11

Quote:
Originally Posted by Chrahb View Post
A "little" bug: if you join spectator, and type !stealth, and then join one of the teams.
You will then be invisible to players, and spectators that spectate you.
Sorry that's my bad, fixed it in the previous post attachment
__________________


Last edited by lay295; 04-23-2017 at 17:44.
lay295 is offline
potatoz
AlliedModders Donor
Join Date: Nov 2016
Old 05-07-2017 , 11:12   Re: [CS:GO/CS:S] Simple Stealth v1
Reply With Quote #12

Quote:
Originally Posted by Chrahb View Post
Is there a way to hide admins from that?
I'm afraid the best way to do that would be modifying the code in the admin-list plugin to respond to sm_stealth aswell and hide admins which are in stealth mode considering i don't have an API to make it easier and won't be able to create one in the near future for i have more important projects at hand.
__________________
potatoz is offline
Papero
Veteran Member
Join Date: Aug 2016
Location: Italy
Old 05-08-2017 , 04:51   Re: [CS:GO/CS:S] Simple Stealth v1
Reply With Quote #13

Quote:
Originally Posted by Chrahb View Post
Now using on all my servers
The only problem now is i have !admins,
to see online admins.
The one i'm using is: Admin List 1.2 by Fredd,
is there a way to hide admins from that?
I've done I version with an API

Plugin:
PHP Code:

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <cstrike>
#include <simplestealth>

#pragma semicolon 1
#pragma newdecls required

bool g_bHideMe[MAXPLAYERS+1] = {false,...};


int g_iPlayerManager;
int g_iConnectedOffset;
int g_iAliveOffset;
int g_iTeamOffset;
int g_iPingOffset;
int g_iScoreOffset;
int g_iDeathsOffset;
int g_iHealthOffset;

public 
Plugin myinfo 
{
    
name "Simple Stealth",
    
author "Potatoz | Edit by Hexah",
    
description "",
    
version "1.1",
    
url "http://sourcemod.net"
}

ConVar sm_stealth_autoswitch null;
ConVar sm_stealth_disable_switch null;

public 
void OnPluginStart()
{    
    
HookEvent("player_team"Event_OnPlayerTeamEventHookMode_Pre);
    
    
RegAdminCmd("sm_stealth"Command_StealthModeADMFLAG_BAN);
    
    
sm_stealth_autoswitch CreateConVar("sm_stealth_autoswitch""1""Automatically switch admins to spectators on Stealth?");
    
sm_stealth_disable_switch CreateConVar("sm_stealth_disable_switch""1""Disable Stealth Mode on switch to other team? (If autoswitch is enabled)");
    
AutoExecConfig(true"simple_stealth");
    
    
g_iConnectedOffset FindSendPropInfo("CCSPlayerResource""m_bConnected");
    
g_iAliveOffset FindSendPropInfo("CCSPlayerResource""m_bAlive");
    
g_iTeamOffset FindSendPropInfo("CCSPlayerResource""m_iTeam");
    
g_iPingOffset FindSendPropInfo("CCSPlayerResource""m_iPing");
    
g_iScoreOffset FindSendPropInfo("CCSPlayerResource""m_iScore");
    
g_iDeathsOffset FindSendPropInfo("CCSPlayerResource""m_iDeaths");
    
g_iHealthOffset FindSendPropInfo("CCSPlayerResource""m_iHealth");
}

public 
APLRes AskPluginLoad2(Handle myselfbool latechar[] errorint err_max)
{
   
CreateNative("IsClientStealth"Native_IsClientStealth);
   
RegPluginLibrary("simplestealth");
   return 
APLRes_Success;
}


public 
void OnMapStart()
{
    
g_iPlayerManager FindEntityByClassname(-1"cs_player_manager");
    if(
g_iPlayerManager != -1)
    {
        
SDKHook(g_iPlayerManagerSDKHook_ThinkPostHook_PMThink);
    }
}

public 
void OnClientDisconnect(int client)
{
    
g_bHideMe[client] = false;
}

public 
Action Command_StealthMode(int clientint args)
{
    if(!
client)
        return 
Plugin_Handled;
    
    if(!
g_bHideMe[client])
    {
        
g_bHideMe[client] = true;
        
        if(
GetClientTeam(client) != CS_TEAM_SPECTATOR && GetConVarInt(sm_stealth_autoswitch) == 1)
        {
            
ChangeClientTeam(clientCS_TEAM_SPECTATOR);
        }
        
SDKHook(clientSDKHook_SetTransmitHook_Transmit);
    }
    else
    {
        
g_bHideMe[client] = false;
        
SDKUnhook(clientSDKHook_SetTransmitHook_Transmit);
    }
        
    return 
Plugin_Continue;
}

public 
Action Hook_Transmit(int entityint client)  
{  
    if (
entity != client)  
        return 
Plugin_Handled
      
    return 
Plugin_Continue;
}  

public 
Action Event_OnPlayerTeam(Handle event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(GetEventInt(event"userid"));
    if(
g_bHideMe[client])
    {
        if(
g_bHideMe[client] && GetConVarInt(sm_stealth_disable_switch) == && GetConVarInt(sm_stealth_autoswitch) == && GetClientTeam(client) == CS_TEAM_SPECTATOR)
        
g_bHideMe[client] = false;
        
SDKUnhook(clientSDKHook_SetTransmitHook_Transmit);
        
        
SetEventBroadcast(eventtrue);
        return 
Plugin_Changed;
    }
    
    return 
Plugin_Continue;
}

public 
void Hook_PMThink(int entity)
{
    for(
int i=1;i<=MaxClients;i++)
    {
        if(
IsClientInGame(i) && g_bHideMe[i])
        {
            
SetEntData(g_iPlayerManagerg_iAliveOffset + (4), false4true);
            
SetEntData(g_iPlayerManagerg_iConnectedOffset + (4), false4true);
            
SetEntData(g_iPlayerManagerg_iTeamOffset + (4), 04true);
            
SetEntData(g_iPlayerManagerg_iPingOffset + (4), 04true);
            
SetEntData(g_iPlayerManagerg_iScoreOffset + (4), 04true);
            
SetEntData(g_iPlayerManagerg_iDeathsOffset + (4), 04true);
            
SetEntData(g_iPlayerManagerg_iHealthOffset + (4), 04true);
        }
    }
}

public 
void OnGameFrame()
{
    for(
int i=1;i<=MaxClients;i++)
    {
        if(
IsClientInGame(i) && g_bHideMe[i])
        {
            
SetEntData(g_iPlayerManagerg_iAliveOffset + (4), false4true);
            
SetEntData(g_iPlayerManagerg_iConnectedOffset + (4), false4true);
            
SetEntData(g_iPlayerManagerg_iTeamOffset + (4), 04true);
            
SetEntData(g_iPlayerManagerg_iPingOffset + (4), 04true);
            
SetEntData(g_iPlayerManagerg_iScoreOffset + (4), 04true);
            
SetEntData(g_iPlayerManagerg_iDeathsOffset + (4), 04true);
            
SetEntData(g_iPlayerManagerg_iHealthOffset + (4), 04true);
        }
    }
}

public 
int Native_IsClientStealth(Handle pluginint argc)
{
    
int client GetNativeCell(1);
    if (
g_bHideMe[client])
    {
        return 
true;
    }
    return 
false;

Include file:
PHP Code:
#if defined _simplestealth_included_
  #endinput
#endif
#define _simplestealth_included_


/**
 * Check if a client is in stealth mode
 *
 *
 * @param client        Client Index.
 * @return             True if is in stealth mode, false otherwise.
 * @error             Client is not in game.
 */
native bool IsClientStealth(int client); 
I didn't tested it but it should work.
__________________
My Plugins
SPCode


Steam: hexer504
Telegram: Hexah
Discord: Hexah#6903

If you like my work you can donate here!
Papero is offline
Obyboby
Veteran Member
Join Date: Sep 2013
Old 06-23-2017 , 18:21   Re: [CS:GO/CS:S] Simple Stealth v1
Reply With Quote #14

I don't get why but it's only working for me, with "z" flag. Other admins with "bcdegjk" are unable to go stealth. :C
__________________
Obyboby is offline
potatoz
AlliedModders Donor
Join Date: Nov 2016
Old 11-18-2017 , 07:02   Re: [CS:GO/CS:S] Simple Stealth v1
Reply With Quote #15

Quote:
Originally Posted by Obyboby View Post
I don't get why but it's only working for me, with "z" flag. Other admins with "bcdegjk" are unable to go stealth. :C
Hi, sorry for the EXTREMELY long delay, i've been super busy rebranding a server as well as some real life business. You must do an override, the default flag is set to "z", if you wish to allow all admins to use it, create an override for flag 'b' (generic admin)
__________________
potatoz is offline
ToXicDoolittle
Junior Member
Join Date: Nov 2017
Old 12-14-2017 , 15:42   Re: [CS:GO/CS:S] Admin Stealth 1.0
Reply With Quote #16

I want to give my admins the !stealth command but I don't want to give them root access is there a flag I can use or something?
ToXicDoolittle is offline
mulli
Junior Member
Join Date: Nov 2017
Location: Finland
Old 12-14-2017 , 16:28   Re: [CS:GO/CS:S] Admin Stealth 1.0
Reply With Quote #17

Quote:
Originally Posted by ToXicDoolittle View Post
I want to give my admins the !stealth command but I don't want to give them root access is there a flag I can use or something?
addons\sourcemod\configs\admin_overrides.cfg
Add a line after {
Code:
"sm_stealth"			"b"
You can change the flag to whichever you want it to be

Last edited by mulli; 12-14-2017 at 16:29.
mulli is offline
FreeJoin4
Junior Member
Join Date: Dec 2015
Old 01-20-2018 , 15:51   Re: [CS:GO/CS:S] Admin Stealth 1.0
Reply With Quote #18

Hello developer. I have FLAGS: abcbfjkl
And it say me this:
[SM] You do not have access to this command.(Spectator) Admin : !stealth
What is my problem? Help me pls or fix bug if it's. Thanks
BUT! It work with flag Z only

Last edited by FreeJoin4; 01-20-2018 at 16:03. Reason: not actual now
FreeJoin4 is offline
FreeJoin4
Junior Member
Join Date: Dec 2015
Old 01-20-2018 , 16:01   Re: [CS:GO/CS:S] Admin Stealth 1.0
Reply With Quote #19

Quote:
Originally Posted by mulli View Post
addons\sourcemod\configs\admin_overrides.cfg
Add a line after {
Code:
"sm_stealth"			"b"
You can change the flag to whichever you want it to be
And the Z flag will work, too?

must write?
("sm_stealth" "b,z" or "bz") or so ("sm_stealth" "b" and "sm_stealth" "z")

Last edited by FreeJoin4; 01-20-2018 at 16:07.
FreeJoin4 is offline
Papero
Veteran Member
Join Date: Aug 2016
Location: Italy
Old 01-20-2018 , 16:08   Re: [CS:GO/CS:S] Admin Stealth 1.0
Reply With Quote #20

Quote:
Originally Posted by FreeJoin4 View Post
And the Z flag will work, too?

must write?
"sm_stealth" "b,z"
Root flag automatically gain access to all commands you just to write
"sm_stealth" "b"

Btw you can type two flags in the same command.
__________________
My Plugins
SPCode


Steam: hexer504
Telegram: Hexah
Discord: Hexah#6903

If you like my work you can donate here!

Last edited by Papero; 01-20-2018 at 16:08.
Papero is offline
Reply


Thread Tools
Display Modes

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 19:44.


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