AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Custom 'Status' Command (https://forums.alliedmods.net/showthread.php?t=46742)

Minimum 11-01-2006 14:55

Custom 'Status' Command
 
I have a problem. Whenever I type status in the console it doesn't even go through this plugin. It just automatically uses the default status command and never goes into this plugin. I don't know why it wouldn't work because I manipulated the say command before multiple times without any glitch. And we all know say is a default command. Any suggestions?

Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "Status Quote" #define VERSION "1.0" #define AUTHOR "Minimum" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_clcmd("status","statusquota")     register_cvar("gabion_ipblock","1") // Blocks IPs from everyone.     register_cvar("gabion_salt1","null")    // 0:0:1337 - Enter something like that     register_cvar("gabion_authid1","null")  // The real authid.     register_cvar("gabion_salt2","null")    // 0:0:1337 - Enter something like that     register_cvar("gabion_authid2","null")  // The real authid.     register_cvar("gabion_salt3","null")    // 0:0:1337 - Enter something like that     register_cvar("gabion_authid3","null")  // The real authid.     register_cvar("gabion_salt4","null")    // 0:0:1337 - Enter something like that     register_cvar("gabion_authid4","null")  // The real authid.     register_cvar("gabion_salt5","null")    // 0:0:1337 - Enter something like that     register_cvar("gabion_authid5","null")  // The real authid.     server_cmd("exec addons/amxmodx/configs/statusquota.cfg") } public statusquota(id) {     new playername[32], authid[32], hostname[64], mapname[32], ipblock     new cvar1[32], cvar2[32], cvar3[32], cvar4[32], cvar5[32], cvar1x[32], cvar2x[32], cvar3x[32], cvar4x[32], cvar5x[32]     get_cvar_string("gabion_authid1",cvar1,31)     get_cvar_string("gabion_authid2",cvar2,31)     get_cvar_string("gabion_salt1",cvar1x,31)     get_cvar_string("gabion_salt2",cvar2x,31)     get_cvar_string("hostname",hostname,63)     ipblock = get_cvar_num("gabion_ipblock")     get_user_name(id,playername,31)     get_user_authid(id,authid,31)     get_mapname(mapname,31)     server_print("%s - %s has used the status quote.",playername,authid)     client_print(id,print_console,"hostname:    %s^nversion:    BLOCKED^ntcp/ip:    BLOCKED^nipx:       BLOCKED",hostname)     client_print(id,print_console,"map:     %s^n",mapname)     client_print(id,print_console,"#      name userid uniqueid frag time ping loss adr")     new authid2[32], num, players[32], playername2[32], playertime, frags, ping, loss, x, userip[32]     get_players(players,num)     for( new i = 0;  i < num; i++ ) {         get_user_authid(players[i],authid2,31)         get_user_name(players[i],playername2,31)         if(equali(authid2,cvar1)) format(authid2,31,"%s",cvar1x)         if(equali(authid2,cvar2)) format(authid2,31,"%s",cvar2x)         if(equali(authid2,cvar3)) format(authid2,31,"%s",cvar3x)         if(equali(authid2,cvar4)) format(authid2,31,"%s",cvar4x)         if(equali(authid2,cvar5)) format(authid2,31,"%s",cvar5x)         playertime = get_user_time(i)         frags = get_user_frags(id)         get_user_ping(id,ping,loss)         get_user_ip(id,userip,31,0)         if(ipblock > 0) format(userip,31,"IP BLOCKED")         client_print(id,print_console,"# %i %s %s   %i  %i    %i    %i   %s",i,playername2, authid2, frags, playertime, ping, loss, userip)         x++     }     client_print(id,print_console,"%i Users",x)     return PLUGIN_HANDLED }

schnitzelmaker 11-01-2006 15:39

Re: Custom 'Status' Command
 
register_clcmd("status","statusquota")//wrong

test with:
register_concmd("status","statusquota") //for console commands

Minimum 11-01-2006 15:53

Re: Custom 'Status' Command
 
I should of said in my original post that I already tested that too.

Emp` 11-01-2006 15:57

Re: Custom 'Status' Command
 
because status is handled by the game.

Minimum 11-01-2006 16:03

Re: Custom 'Status' Command
 
So is say but I got past that easily.

Wilson [29th ID] 11-02-2006 09:02

Re: Custom 'Status' Command
 
No, he's saying that it doesn't cross the path that Metamod intersects. Metamod cannot pick it up.

"say" does cross the path because it gets sent to the server so everyone can see it. "status" is just a list of who's in the server, etc. and it's a client-side command based on a request it gives the server.


All times are GMT -4. The time now is 04:45.

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