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

[ANY] Stealth Revived (v1.0.1, 19/01/20)


Post New Thread Reply   
 
Thread Tools Display Modes
SM9
Veteran Member
Join Date: Sep 2013
Location: United Kingdom
Old 02-17-2020 , 23:16   Re: [ANY] Simple Stealth (v1.0, 18/01/20)
Reply With Quote #81

Updated 1.0.0 -
  • Removed Fake Disconnect / Connect (Now it wont show any messages)
    • I will attempt to fix this later but it has been very problematic, causing issues with radar, event messages showing 'Unconnected' etc.
  • Remove SteamTools support - Use SteamWorks already!
  • Remove Updater support.
  • Fixed PTaH hook.
  • Fixed 'version' in status.
  • Improved SetTransmit performance when using 'sm_simplestealth_hidecheats' by only hooking stealthed clients.
  • Removed 'status' cmd interval ConVar to keep things simple.
  • General fixes.

Last edited by SM9; 02-18-2020 at 04:36.
SM9 is offline
SM9
Veteran Member
Join Date: Sep 2013
Location: United Kingdom
Old 02-18-2020 , 23:10   Re: [ANY] Stealth Revived (v1.0.1, 19/01/20)
Reply With Quote #82

Updated 1.0.1 -
  • Fix bad logic in status command hook.
SM9 is offline
ImACow
AlliedModders Donor
Join Date: Feb 2015
Old 03-07-2020 , 06:21   Re: [ANY] Stealth Revived (v1.0.1, 19/01/20)
Reply With Quote #83

Players can use "ping" to still see the list of connected players
__________________
ImACow is offline
lemeshovich
Member
Join Date: Jun 2011
Old 04-06-2020 , 07:28   Re: [ANY] Stealth Revived (v1.0.1, 19/01/20)
Reply With Quote #84

Quote:
Originally Posted by ImACow View Post
Players can use "ping" to still see the list of connected players
you can add this to block ping command
Code:
if (StrContains(commandName2, "ping") != -1) {
	PrintToConsole(client, "Unknown command: %s", commandName2);
	return Plugin_Handled;
}

Last edited by lemeshovich; 04-06-2020 at 07:31.
lemeshovich is offline
qanbaz
New Member
Join Date: Oct 2020
Old 10-22-2020 , 08:23   Re: [ANY] Stealth Revived (v1.0.1, 19/01/20)
Reply With Quote #85

Quote:
Originally Posted by lemeshovich View Post
you can add this to block ping command
Code:
if (StrContains(commandName2, "ping") != -1) {
	PrintToConsole(client, "Unknown command: %s", commandName2);
	return Plugin_Handled;
}
Greetings , Im not sure when am I suppose to add this , should I start a new plugin or add this in the sp file for this particular plugin in the on plugin start , or where exactly... Im totally lost and I need to stop the ping command on my server
qanbaz is offline
Sreaper
髪を用心
Join Date: Nov 2009
Old 11-30-2020 , 23:21   Re: [ANY] Stealth Revived (v1.0.1, 19/01/20)
Reply With Quote #86

While the plugin hides admin names from 'status' it doesn't hide them from 'ping'. Great plugin nonetheless, thank you.
Sreaper is offline
lemeshovich
Member
Join Date: Jun 2011
Old 02-16-2021 , 20:28   Re: [ANY] Stealth Revived (v1.0.1, 19/01/20)
Reply With Quote #87

Quote:
Originally Posted by qanbaz View Post
Greetings , Im not sure when am I suppose to add this , should I start a new plugin or add this in the sp file for this particular plugin in the on plugin start , or where exactly... Im totally lost and I need to stop the ping command on my server
Quote:
Originally Posted by Sreaper View Post
While the plugin hides admin names from 'status' it doesn't hide them from 'ping'. Great plugin nonetheless, thank you.
guys, just add this block to the empty line 258 in StealthRevived.sp and then recompile the plugin
Quote:
Originally Posted by lemeshovich View Post
Code:
if (StrContains(commandName2, "ping") != -1) {
	PrintToConsole(client, "Unknown command: %s", commandName2);
	return Plugin_Handled;
}

Last edited by lemeshovich; 02-16-2021 at 20:31.
lemeshovich is offline
`666
AlliedModders Donor
Join Date: Jan 2006
Old 02-17-2021 , 06:50   Re: [ANY] Stealth Revived (v1.0.1, 19/01/20)
Reply With Quote #88

Basic version for insurgency

PHP Code:
/****************************************************************************************************
    Stealth Revivived
*****************************************************************************************************

*****************************************************************************************************
    CHANGELOG: 
            0.1 - First version.
            0.2 - 
                - Improved spectator blocking with SendProxy (If installed) - Credits to Chaosxk
                - Make PTaH optional, sm_stealth_customstatus wont work in CSGO unless PTaH is installed until we find a way to rewrite status without dependencies.
                - Only rewrite status if there is atleast 1 stealthed client.
                - Improved late loading to account for admins already in spectator.
                - Improved support for other games, Still need to do the status rewrite for other games though.
                - Improved status anti-spam.
            0.3 - 
                - Fixed variables not being reset on client disconnect.
                - Added intial TF2 support (Needs further testing)
            0.4 - 
                - Use SteamWorks or SteamTools for more accurate IP detection, If you have both installed then only SteamWorks is used.
            0.5 - 
                - Fix console ending loop (Thanks Bara for report)
                - Fix error spam in TF2 (Thanks rengo)
                - Fixed TF2 disconnect reason (Thanks Drixevel)
            0.6 - 
                - Fix more error spam scenarios (Thanks rengo)
                - Correct TF2 disconnect reason.
                - Misc code changes.
            0.7 - 
                - Fixed issue with fake disconnect event breaking hud / radar.
                - Improved logic inside fake event creation.
                - General fixes.
            0.8 - 
                - Fixed issue where team broadcast being disabled caused the team menu to get stuck.
                - Fixed bad logic in SendProxy Callback.
                - Fixed "unconnected" bug on team changes.
                - Added check to make sure team event exists.
            0.9 - 
                - Removed SendProxy (It's too problematic)
                - Added a ConVar 'sm_stealthrevived_hidecheats' for cheat blocking (SetTransmit is inherently expensive thus this option can cause performance issues on some setups)
            0.9.1 - 
                - Support PtaH 1.1.0 (fix by FIVE)
            1.0.0 -
                - Removed Fake Disconnect / Connect (Now it wont show any messages)
                    - I will attempt to fix this later but it has been very problematic, causing issues with radar, event messages showing 'Unconnected' etc.
                - Remove SteamTools support - Use SteamWorks already!
                - Remove Updater support.
                - Fixed PTaH hook.
                - Fixed 'version' in status.
                - Improved SetTransmit performance when using 'sm_stealthrevived_hidecheats' by only hooking stealthed clients.
                - Removed 'status' cmd interval ConVar to keep things simple.
                - General fixes.
            1.0.1 -
                - Fix bad logic in status command hook.
                
*****************************************************************************************************
*****************************************************************************************************
    INCLUDES
*****************************************************************************************************/
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <StealthRevived>

/****************************************************************************************************
    DEFINES
*****************************************************************************************************/
#define PL_VERSION "1.0.2"
#define LoopValidPlayers(%1) for(int %1 = 1; %1 <= MaxClients; %1++) if(IsValidClient(%1))

/****************************************************************************************************
    ETIQUETTE.
*****************************************************************************************************/
#pragma newdecls required;
#pragma semicolon 1;

/****************************************************************************************************
    PLUGIN INFO.
*****************************************************************************************************/
public Plugin myinfo =  {
    
name "Stealth Revived"
    
author "SM9();"
    
description "Just another Stealth plugin."
    
version PL_VERSION
    
url "https://github.com/SM9CC/StealthRevived"
}

bool    g_bStealthed[MAXPLAYERS 1],
        
g_bHooked false;

int        g_iPlayerManager = -1,
        
g_bLateLoad;


public 
void OnPluginStart() {
    if (!
HookEventEx("player_team"Event_PlayerTeam_PreEventHookMode_Pre)) {
        
SetFailState("player_team event does not exist on this mod, plugin disabled");
        return;
    }

    
HookEvent("player_connect"Event_PlayerConnect_PreEventHookMode_Pre);
    
HookEvent("player_disconnect"Event_PlayerDisconnect_PreEventHookMode_Pre);
    
HookEvent("player_pick_squad"Event_PlayerPickSquad_PostEventHookMode_Post);
}

public 
APLRes AskPluginLoad2(Handle myselfbool latechar[] erorint err_max) {
    
g_bLateLoad late;
    
RegPluginLibrary("StealthRevived");
    
CreateNative("SR_IsClientStealthed"Native_IsClientStealthed);
    return 
APLRes_Success;
}

public 
void OnMapStart() {
    
g_iPlayerManager GetPlayerResourceEntity();
    if (
g_iPlayerManager == -1) {
        
SetFailState("\"GetPlayerResourceEntity\" not found!");
    }

    if (
g_bLateLoad) {
        
g_bLateLoad false;
        for (
int i 1<= MaxClientsi++) {
            if (!
IsClientInGame(i) || IsFakeClient(i) || !CanGoStealth(i)) {
                continue;
            }
            if (!
g_bHooked) {
                
SDKHook(g_iPlayerManagerSDKHook_ThinkPostHook_PlayerManagerThinkPost);
                
g_bHooked true;
            }
        }
    }
}

public 
void OnMapEnd() {
    
g_bHooked false;
}

public 
Action Event_PlayerTeam_Pre(Event event, const char[] namebool dontBroadcast) {
    
int client;
    if (!(
client GetClientOfUserId(event.GetInt("userid"))) || IsFakeClient(client)) {
        return 
Plugin_Continue;
    }

    if (
CanGoStealth(client)) {
        
event.BroadcastDisabled true;
        
g_bStealthed[client] = true;
    }

    return 
Plugin_Continue;
}

public 
Action Event_PlayerPickSquad_Post(Event event, const char[] namebool dontBroadcast) {
    
int client;
    if (!(
client GetClientOfUserId(event.GetInt("userid"))) || IsFakeClient(client)) {
        return 
Plugin_Continue;
    }
    
    if (
g_bStealthed[client]) g_bStealthed[client] = false;
    return 
Plugin_Continue;
}

//broadcast fake "joined the game." msg
public void OnClientPostAdminCheck(int client) {
    if (!
IsFakeClient(client)) {
        if (!
CanGoStealth(client)) {
            
PrintToChatAll("%N joined the game."client);
        }
        else if (!
g_bHooked) {
            
SDKHook(g_iPlayerManagerSDKHook_ThinkPostHook_PlayerManagerThinkPost);
            
g_bHooked true;
        }
    }
}

//to block "joined the game." msg so admin sneakily joins the game :D
public Action Event_PlayerConnect_Pre(Event event, const char[] namebool dontBroadcast) {
    
event.BroadcastDisabled true;
    return 
Plugin_Continue;
}

//block disconnect msg if client in stealth
public Action Event_PlayerDisconnect_Pre(Event event, const char[] namebool dontBroadcast){
    
int client;
    if (!(
client GetClientOfUserId(event.GetInt("userid"))) || IsFakeClient(client)) {
        return 
Plugin_Continue;
    }
    
    if (
g_bStealthed[client]) {
        
event.BroadcastDisabled true;
        
g_bStealthed[client] = false;
    }

    return 
Plugin_Continue;
}

public 
void Hook_PlayerManagerThinkPost(int entity) {
    
bool changed false;
    
    
LoopValidPlayers(client) {
        if (!
g_bStealthed[client]) {
            continue;
        }
        
        
SetEntProp(g_iPlayerManagerProp_Send"m_bConnected"false_client);
        
changed true;
    }
    
    if (
changed) {
        
ChangeEdictState(entity);
    } else {
        
SDKUnhook(g_iPlayerManagerSDKHook_ThinkPostHook_PlayerManagerThinkPost);
        
g_bHooked false;
    }
}

stock bool IsValidClient(int clientbool ignoreBots true) {
    if (
client || client MaxClients) {
        return 
false;
    }
    
    if (!
IsClientInGame(client)) {
        return 
false;
    }
    
    if (
IsFakeClient(client) && ignoreBots) {
        return 
false;
    }
    
    return 
true;
}

stock bool CanGoStealth(int client) {
    return 
CheckCommandAccess(client"admin_stealth"ADMFLAG_KICK);
}

public 
int Native_IsClientStealthed(Handle pluginint numParams) {
    
int client GetNativeCell(1);
    return 
g_bStealthed[client];


Last edited by `666; 10-20-2022 at 15:18. Reason: unhook when no admin in stealth
`666 is offline
Ejziponken
AlliedModders Donor
Join Date: Apr 2008
Old 04-05-2021 , 13:36   Re: [ANY] Stealth Revived (v1.0.1, 19/01/20)
Reply With Quote #89

From what I can tell, "status" still shows my admins on my retake servers. Using latest ptah from main post.

Also I cant even get this part to work:

Quote:
if (StrContains(commandName2, "ping") != -1) {
PrintToConsole(client, "Unknown command: %s", commandName2);
return Plugin_Handled;
}

Last edited by Ejziponken; 04-05-2021 at 14:12.
Ejziponken is offline
`666
AlliedModders Donor
Join Date: Jan 2006
Old 04-03-2022 , 06:02   Re: [ANY] Stealth Revived (v1.0.1, 19/01/20)
Reply With Quote #90

With "OnMapStart" and "OnEntityCreated" hook, the plugin ends up hooking the same entity twice.
`666 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 17:12.


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