Raised This Month: $ Target: $400
 0% 

Hidden SourceTV


Post New Thread Reply   
 
Thread Tools Display Modes
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 08-30-2013 , 18:42   Re: Hidden SourceTV
Reply With Quote #11

Quote:
Originally Posted by Remas View Post
I've said everything that I wanted to say and then I was answering other people. Is that considered spamming? (not counting these last two posts which i could have made into one)
Two posts, one minute apart, aren't worthwhile. Combine them. That's what editing it for.
__________________
11530 is offline
Remas
Junior Member
Join Date: May 2013
Location: United Kingdom
Old 08-30-2013 , 18:47   Re: Hidden SourceTV
Reply With Quote #12

Sorry. Anyways, do you have any idea how to help my question or do you need more details?
__________________
Best Regards.
Remas
Remas is offline
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 08-30-2013 , 20:23   Re: Hidden SourceTV
Reply With Quote #13

Quote:
Originally Posted by Remas View Post
The scoreboard part works perfectly and the demos are recording fine as well (at least they did).
Ah, I'm sorry -- I didn't see that you already had a solution for the scoreboard, and it's not my buggy one Nice thinking, I'll try it out on TF2 later.

IsClientSourceTV should be working, though. Perhaps check for it in a different way:
PHP Code:
for (new 1<= MaxClientsi++)
{
    if (!
IsClientInGame(i)) continue;
    if (!
IsClientSourceTV(i)) continue;
    
ReplyToCommand(client"Client %i (%N) is the SourceTV bot"ii);
    return 
Plugin_Handled;
}
ReplyToCommand(client"SourceTV bot not found");
return 
Plugin_Handled
If it's still not working, make sure your gamedata is up-to-date and that you're on SM 1.5, not 1.6.
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
MasterOfTheXP is offline
Remas
Junior Member
Join Date: May 2013
Location: United Kingdom
Old 08-31-2013 , 00:36   Re: Hidden SourceTV
Reply With Quote #14

So, do i paste what you've wrote in between the loop and the printing so it looks like this? If not then where should I add it? (I will remind everyone I am a total newbie when it comes to programming in SourcePawn ) :

PHP Code:
#pragma semicolon 1 

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

public Plugin:myinfo 

    
name "Hide SourceTV" 
}; 

new 
Handle:g_hHostname INVALID_HANDLE

public 
OnPluginStart() 

    
g_hHostname FindConVar("hostname"); 


public 
OnMapStart()  

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


public 
Hook_OnThinkPost(iEnt) { 
    static 
iConnectedOffset = -1
    if (
iConnectedOffset == -1)  
        { 
            
iConnectedOffset FindSendPropInfo("CCSPlayerResource""m_bConnected"); 
        } 
     
    new 
iConnected[35]; 
    
GetEntDataArray(iEntiConnectedOffsetiConnected35); 
     
    for (new 
135i++)  
    { 
        if (
iConnected[i] && IsClientSourceTV(i))  
            { 
                
iConnected[i] = 0
            } 
    } 
     
    
SetEntDataArray(iEntiConnectedOffsetiConnected35); 
}   



     
     
bool:ValidPlayer(i

    if(
i>&& i<=MaxClients && IsClientConnected(i) && IsClientInGame(i)) 
    { 
        return 
true
    } 
    return 
false
}     


FormatShortTime(timeString:outTime[],size

    new 
temp
    
temp time%60
    
Format(outTime,size,"%02d",temp); 
    
temp = (time%3600)/60
    
Format(outTime,size,"%02d:%s",temp,outTime); 
    
temp = (time%86400)/3600
    if(
temp>0
    { 
        
Format(outTime,size,"%d%:s",temp,outTime); 

    } 



     
public 
Action:Command_Status(client, const String:command[], args

    new 
String:buffer[64]; 
    
GetConVarString(g_hHostname,buffer,sizeof(buffer)); 
    
PrintToConsole(client,"hostname: %s",buffer); 
    
PrintToConsole(client,"version : 1.0.0.73/22 5028 secure"); 
    
GetCurrentMap(buffer,sizeof(buffer)); 
    
PrintToConsole(client,"map     : %s at: 0 x, 0 y, 0 z",buffer); 
    
PrintToConsole(client,"# userid name                 uniqueid            connected ping loss state"); 
    new 
String:name[18]; 
    new 
String:steamID[19]; 
    new 
String:time[9]; 
    for(new 
i<= MaxClientsi++) 
    { 
         if (!
IsClientInGame(i)) continue; 
         if (!
IsClientSourceTV(i)) continue; 
         
ReplyToCommand(client"Client %i (%N) is the SourceTV bot"ii); 
         return 
Plugin_Handled
    } 
ReplyToCommand(client"SourceTV bot not found"); 
return 
Plugin_Handled;  
     
     
        if(
IsClientSourceTV(i)) 
        { 
            
PrintToChatAll("Test"); 
        } 
        else 
        { 
            
Format(name,sizeof(name),"\"%N\"",i); 
            
GetClientAuthString(i,steamID,sizeof(steamID)); 
            if(
ValidPlayer(i)) 
            { 
                
FormatShortTime(RoundToFloor(GetClientTime(i)),time,sizeof(time)); 
                
PrintToConsole(client,"# %6d %-19s %19s %9s %4d %4d active",GetClientUserId(i),name,steamID,time,RoundToFloor(GetClientAvgLatency(i,NetFlow_Both) * 1000.0),RoundToFloor(GetClientAvgLoss(i,NetFlow_Both)*100.0)); 
            }  
            else  
            { 
                
PrintToChatAll("Test2"); 
            } 
        } 
    } 
    return 
Plugin_Stop
__________________
Best Regards.
Remas
Remas is offline
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 08-31-2013 , 03:33   Re: Hidden SourceTV
Reply With Quote #15

uh this is fugly, if you want to properly hide the sourcetv from status you should use an extension to detour Host_Status_PrintClient, its called for every single client when someone types 'status' in console and you could just block it so it doesnt prints anything for sourcetv, not even a new line

without further explanation:

Code:
DETOUR_DECL_STATIC3(Host_Status_PrintClient, void, IClient*, client, bool, rcon, void*, fv)
{
        if(!rcon && client->IsHLTV())
                return;
}
__________________
Taking private C++/PHP/SourcePawn requests, PM me.

Last edited by Zephyrus; 08-31-2013 at 03:43.
Zephyrus is offline
napalm00
Veteran Member
Join Date: Jun 2011
Location: Italy, sadly
Old 08-31-2013 , 03:37   Re: Hidden SourceTV
Reply With Quote #16

Quote:
Originally Posted by Zephyrus View Post
uh this is fugly, if you want to properly hide the sourcetv from status you should use an extension to detour Host_Status_PrintClient, its called for every single client when someone types 'status' in console and you could just block it so it doesnt prints anything for sourcetv, not even a new line
^ this
__________________
napalm00 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 08:24.


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