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

ServerClass names?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Remas
Junior Member
Join Date: May 2013
Location: United Kingdom
Old 05-29-2013 , 20:12   ServerClass names?
Reply With Quote #1

Hello there. I am messing around with bl4nk's source code he came up with. Basically the plugin is supposed to hide Source TV so no one can see it. I am a total newbie when it comes to Sourcepawn and programming itself but I'm slowly starting to understand a tiny bit of it so please don't hate on me . I changed one bit from his original code so it detects Source TV now (his original plugin detects and hides all BOTs including bot players which i dont want)

It does the job, kind of. When you type "status" into your console you can still see that SourceTV is there. Now, after all this reading you are coming up to my question. I am wondering if there is a way and if any of you could help me get rid of it showing up when typing "status" into the console.

I am also wondering what ServerClass is and if there is a list of these classes or something? The reason i am asking is because in one of the commands he used in his code (FindSendPropOffs) the note from docs.sourcemod.net website says "Given a ServerClass name".

Here is the source code for that plugin:

Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

public Plugin:myinfo = {
    name = "Hide SourceTV",
    author = "bl4nk",
    description = "Hides SourceTV from the scoreboard",
    version = "1.0.0",
    url = "http://forums.alliedmods.net/"
};

public OnMapStart() {
    new iIndex = FindEntityByClassname(MaxClients+1, "cs_player_manager");
    if (iIndex == -1) {
        SetFailState("Unable to find player manager entity");
    }
    
    SDKHook(iIndex, SDKHook_ThinkPost, Hook_OnThinkPost);
}

public Hook_OnThinkPost(iEnt) {
    static iConnectedOffset = -1;
    if (iConnectedOffset == -1) 
		{
			iConnectedOffset = FindSendPropInfo("CCSPlayerResource", "m_bConnected");
		}
    
    new iConnected[35];
    GetEntDataArray(iEnt, iConnectedOffset, iConnected, 35);
    
    for (new i = 1; i < 35; i++) 
	{
        if (iConnected[i] && IsClientSourceTV(i)) 
			{
				iConnected[i] = 0;
			}
    }
    
    SetEntDataArray(iEnt, iConnectedOffset, iConnected, 35);
}
Remas is offline
Remas
Junior Member
Join Date: May 2013
Location: United Kingdom
Old 05-30-2013 , 11:25   Re: ServerClass names?
Reply With Quote #2

Anyone?
__________________
Best Regards.
Remas
Remas is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-30-2013 , 11:48   Re: ServerClass names?
Reply With Quote #3

You're better off in this case using SetEntProp instead, which doesn't require you to know the ServerClass:

PHP Code:
SetEntProp(iEntProp_Send"m_bConnected"iConnected[i], i); 
Having said that, server classes are listed in netprops or datamaps dumps. Having said that, there are a lot of them.

Edit: That code's not quite right, as you need the client index for iConnected[i] and i

Incidentally, i < 35 should be i <= MaxClients
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 05-30-2013 at 11:54.
Powerlord is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-30-2013 , 11:58   Re: ServerClass names?
Reply With Quote #4

Ah hell, it's just easier if I redo all the code

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

public Plugin:myinfo = {
    
name "Hide SourceTV",
    
author "bl4nk",
    
description "Hides SourceTV from the scoreboard",
    
version "1.0.0",
    
url "http://forums.alliedmods.net/"
};

public 
OnMapStart() {
    new 
iIndex FindEntityByClassname(MaxClients+1"cs_player_manager");
    if (
iIndex == -1) {
        
SetFailState("Unable to find player manager entity");
    }
    
    
SDKHook(iIndexSDKHook_ThinkPostHook_OnThinkPost);
}

public 
Hook_OnThinkPost(iEnt) {
    for (new 
1<= MaxClientsi++) 
    {
        if (
IsClientSourceTV(i))
        {
            if (
GetEntProp(iEntProp_Send"m_bConnected"i) != 0
            {
                
SetEntProp(iEntProp_Send"m_bConnected"0i);
            }
            break;
        }
    }

__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 05-30-2013 at 11:59.
Powerlord is offline
Remas
Junior Member
Join Date: May 2013
Location: United Kingdom
Old 05-30-2013 , 12:01   Re: ServerClass names?
Reply With Quote #5

Will that remove STV from scoreboard and "status" command in the console?
__________________
Best Regards.
Remas
Remas is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-30-2013 , 13:00   Re: ServerClass names?
Reply With Quote #6

Quote:
Originally Posted by Remas View Post
Will that remove STV from scoreboard and "status" command in the console?
I don't know, this code just does what it appeared you were trying to do. Looking at the code, it just makes the SourceTV client's index appear to be unconnected to the server and players.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 05-30-2013 at 13:01.
Powerlord is offline
Remas
Junior Member
Join Date: May 2013
Location: United Kingdom
Old 05-30-2013 , 13:01   Re: ServerClass names?
Reply With Quote #7

It works as it should, just checked it. One thing is missing though. I am not sure if it is possible but as i mentioned above is it possible to remove STV from the "status" list in the console?

@edit
__________________
Best Regards.
Remas

Last edited by Remas; 05-30-2013 at 13:04. Reason: added a screenshot
Remas is offline
mcpan313
Senior Member
Join Date: Mar 2010
Old 05-30-2013 , 22:19   Re: ServerClass names?
Reply With Quote #8

Quote:
Originally Posted by Remas View Post
It works as it should, just checked it. One thing is missing though. I am not sure if it is possible but as i mentioned above is it possible to remove STV from the "status" list in the console?
Change SourceTV name?
__________________
sorry, for my poor english.
mcpan313 is offline
Send a message via MSN to mcpan313
Remas
Junior Member
Join Date: May 2013
Location: United Kingdom
Old 05-31-2013 , 01:56   Re: ServerClass names?
Reply With Quote #9

I could try it and i will if i have to but it will look suspicious if someone sees it. Is there a way to remove it completely from that list?
__________________
Best Regards.
Remas
Remas is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 05-31-2013 , 02:16   Re: ServerClass names?
Reply With Quote #10

As far as I know, you'd have to completely redo the STATUS command. I know that something similar is done in the Admin Stealth plugin.

Last edited by ddhoward; 05-31-2013 at 02:18.
ddhoward 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:48.


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