Raised This Month: $ Target: $400
 0% 

Console command


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
YParushev
Junior Member
Join Date: Mar 2016
Old 06-29-2016 , 14:25   Console command
Reply With Quote #1

Hello, can you detect a console command when a player enters the server, but the command has no value. I tried to query_client_cvar, but the result is zero returns "Bad CVAR request" and not take action because the command has no value.

Code:
#include <amxmodx> 
#include <colorchat>

public client_putinserver(id){
  set_task(5.0,"checkcm",id);
}
 

public checkcm(id){
  query_client_cvar(id, "CommandsWithoutValue","checkcommands" );
}
 
 public checkcommands(id,const cvar[],const value[]) {
   new name[33];
  get_user_name(id,name,charsmax(name));
  if (value[0] != 'B') {

       ColorChat(0,NORMAL,"Player %s uses Hack cvar %s",name,cvar)
       server_cmd("kick #%d ^"Hack Detected^"",get_user_userid(id))
  }
  else
  {
       ColorChat(0,NORMAL, "Players %s no Cvar %s",name,cvar);
  }
 
 }

Last edited by YParushev; 06-29-2016 at 14:27.
YParushev is offline
 



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 10:03.


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