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

[CSGO] Block Commands


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 08-04-2019 , 15:17   [CSGO] Block Commands
Reply With Quote #1

hi guys!
i want blocking "status" command for players, but i need this command on server console for sourcebans web panel!!

How do I check if the command is sent by the sourcebans++ webpanel?

thank you
Dr.Mohammad is offline
Squallkins
AlliedModders Donor
Join Date: Mar 2005
Old 08-06-2019 , 21:34   Re: [CSGO] Block Commands
Reply With Quote #2

check if client == 0
Squallkins is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 08-07-2019 , 23:31   Re: [CSGO] Block Commands
Reply With Quote #3

Quote:
Originally Posted by Squallkins View Post
check if client == 0
dont work:

i think this bug for sourcemod!!

check by client:
PHP Code:
public void OnPluginStart()
{
  
RegConsoleCmd("status"Command_Status);
}
 
public 
Action Command_Status(int clientint args)
{
  if(
client == 0){
    
LogMessage("Client: %d"client);
 return 
Plugin_Continue;
  }
  
LogMessage("Client: %d"client);
  return 
Plugin_Handled;

log:
HTML Code:
L 08/05/2019 - 09:10:12: [Security_status_ping_block.smx] Client: 0
L 08/05/2019 - 09:10:34: [Security_status_ping_block.smx] Client: 0
L 08/05/2019 - 09:12:31: [Security_status_ping_block.smx] Client: 0
check by name:
PHP Code:
#include <sourcemod>

#pragma semicolon 1
#pragma newdecls required

char Char_DefHostName[128];
char Char_FindConvar[128];

public 
void OnPluginStart()
{
    
GetCommandLineParam("+hostname"Char_DefHostNamesizeof(Char_DefHostName),"normal");
    
    if(
StrEqual(Char_DefHostName,"normal"))
    {
        
GetConVarString(FindConVar("hostname"), Char_FindConvarsizeofChar_FindConvar));
        
Char_DefHostName Char_FindConvar;
    }
    
    
RegConsoleCmd("status"Command_Status);
}
 
public 
Action Command_Status(int clientint args)
{
    
char Name[128];
    
GetClientName(clientNamesizeof(Name));
    
LogMessage("Server name: %s"Char_DefHostName);
    
LogMessage("Client Name: %s"Name);
    if(
StrEqual(Char_DefHostNameNametrue))
    {
        return 
Plugin_Continue;
    }
    else
    {
        return 
Plugin_Handled;
    }

log:
HTML Code:
L 08/05/2019 - 09:28:17: [security_status_ping_block.smx] Server name: Public #1 Server
L 08/05/2019 - 09:28:17: [security_status_ping_block.smx] Client Name: Public #1 Server
L 08/05/2019 - 09:28:43: [security_status_ping_block.smx] Server name: Public #1 Server
L 08/05/2019 - 09:28:43: [security_status_ping_block.smx] Client Name: Public #1 Server

Last edited by Dr.Mohammad; 08-09-2019 at 04:27.
Dr.Mohammad is offline
Nexd
BANNED
Join Date: Dec 2013
Location: Hungary
Old 08-08-2019 , 04:11   Re: [CSGO] Block Commands
Reply With Quote #4

Code:
return Plugin_Continue; 
LogMessage("Client: %d", client);
?
Nexd is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 08-09-2019 , 04:28   Re: [CSGO] Block Commands
Reply With Quote #5

Quote:
Originally Posted by Nexd View Post
Code:
return Plugin_Continue; 
LogMessage("Client: %d", client);
?
i edited and tested but this not worked!!
Dr.Mohammad is offline
Mr.Freeman
Senior Member
Join Date: Nov 2013
Location: Canada
Old 08-09-2019 , 10:59   Re: [CSGO] Block Commands
Reply With Quote #6

Try this (Havent tested this in over a year)

PHP Code:
public void OnPluginStart() {
    
AddCommandListener(BlockCommandCallback"status");
}

public 
Action BlockCommandCallback(int client, const char[] commandint argc) {
    return 
Plugin_Handled;

__________________
Feel Free to PM me about any questions, I'll do my best to help
Mr.Freeman is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 08-13-2019 , 16:20   Re: [CSGO] Block Commands
Reply With Quote #7

Check how it's done here: https://bitbucket.org/SM91337/stealt...althRevived.sp
__________________
zipcore 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:17.


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