Raised This Month: $ Target: $400
 0% 

Excluding some things in amx_help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 11-27-2005 , 18:06   Excluding some things in amx_help
Reply With Quote #1

It might sound weird, but UAIO takes up about 100 or so of my commands, so i was wondering if in adminhlep.sam i can do like an exclude of "UAIO" commands or something? Just wondering guys.

The only thing I found was on get_concmd
Code:
/* Gets info about console command. If id is set to 0, then function returns only server cmds, if positive then returns only client cmds. in other case returns all console commands. */ native get_concmd(index,cmd[],len1,&flags, info[],len2, flag, id = -1);

Not sure how to exclude anything...

THankx
__________________
bmann_420 is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 11-28-2005 , 06:17  
Reply With Quote #2

1. Add to the top of adminhelp.sma this:
Code:
// #define EXCLUDED_NUM 3 new const excluded[EXCLUDED_NUM][] = {     "command1",     "command2",     "command3" }
This is an exaple so make sure that you put right EXCLUDED_NUM and command list.

2. Replace:
Code:
//     for (new i = start; i < end; i++)     {         get_concmd(i, cmd, 31, eflags, info, 127, flags, id)         console_print(id, "%3d: %s %s", i + 1, cmd, info)     }
with
Code:
//     new skipped = 0     new clcmds = clcmdsnum     for (new i = 0; i < clcmds; i++)     {         get_concmd(i, cmd, 31, eflags, info, 127, flags, id)         new bool:skip = false         for (new j = 0; j < EXCLUDED_NUM; ++j) {             if (equal(cmd, excluded[j])) {                 skip = true                 skipped++                 clcmdsnum--                 if (start >= clcmdsnum)                     start = clcmdsnum - 1                 if (end > clcmdsnum)                     end = clcmdsnum                 break             }         }         if (skip)             continue         new cmdnum = i - skipped         if (cmdnum >= start && cmdnum < end)             console_print(id, "%3d: %s %s", cmdnum + 1, cmd, info)     }
VEN is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 11-28-2005 , 06:45  
Reply With Quote #3

Better way. This way you dont need to put all the commands just the prefixes
1. Add to the top of adminhelp.sma this:
Code:
// #define EXCLUDED_NUM 3 new const excluded[EXCLUDED_NUM][] = {     "uaio_",     "any_prefix",     "this_too" }
This is will block all the uaio commands plus any other prefixes you want.

2. Replace:
Code:
//     for (new i = start; i < end; i++)     {         get_concmd(i, cmd, 31, eflags, info, 127, flags, id)         console_print(id, "%3d: %s %s", i + 1, cmd, info)     }
with
Code:
//     new iCount = 0     new bool:skip = false     for (new i = start; i < end; i++)     {         skip = false         get_concmd(i, cmd, 31, eflags, info, 127, flags, id)         for(new x = 0 ; x < EXCLUDED_NUM ; x++ )         {             if(containi( cmd , excluded[x]) > -1 )             {                 skip = true                 break             }         }         if(skip)             continue         console_print(id, "%3d: %s %s", iCount++, cmd, info)     }

[EDIT] I fixed the code to work....Like VEN said this will show the wrong numbers(It wont exclude the commands from the numbers) But now it will show the commands. (It will show 0 commands if the whole page would have been uaio)
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 11-28-2005 , 18:55  
Reply With Quote #4

sweet, thanks guy. ALot of help!

EDIT: VEN's worked, sorry suicide but your diddnt, i cant copy and past the errors from cmd or i would, but there was about 4 errors.

EDIT: Tested, not working for the top one i put "uaio_" the comand 2 and command 3 since i dont use them. But they still come up in help.
Code:
#define EXCLUDED_NUM 3 new const excluded[EXCLUDED_NUM][] = {     "uaio_",     "command2",     "command3" }

i tried "uaio" and no _ also, but not workin

I got your to compile suicide, you were just missing ) at the end of something but this is what happens when i type amx_help with suidid's
Code:
] amx_help 200 ----- AMX Mod X Help: Commands ----- ----- Entries 200 - 249 of 269 ----- ----- Use 'amx_help 250' for more ----- Type 'amx_help' in the console to see available commands ] amx_help ----- AMX Mod X Help: Commands ----- ----- Entries 1 - 50 of 269 ----- ----- Use 'amx_help
__________________
bmann_420 is offline
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 11-29-2005 , 23:17  
Reply With Quote #5

No more help? Poo
__________________
bmann_420 is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 12-01-2005 , 06:06  
Reply With Quote #6

Quote:
Originally Posted by Suicid3
you dont need to put all the commands just the prefixes
Yes i thought about that but i wasn't sure that he want block only commands with similar prefixes so i post more common code.

Quote:
Originally Posted by bmann_420
No more help? Poo
Sorry for the delay.
Did you want exclude commands like amx_bury, amx_blind etc? If so just put all commands to the list on the top.

EDIT:

Code:
----- Entries A - B of C -----
----- Use 'amx_help D' for more -----
Do not use Suicid3's code if you want to display right A, B, C, D numbers.
VEN is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 12-01-2005 , 12:19  
Reply With Quote #7

I fixed my code.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 12-01-2005 , 13:40  
Reply With Quote #8

I only wanted uaio blocked, and ill try it suicide.

Okay it works, its just funny

Cause it shows all commands but when you do amx_help 200 nothing comes up like it did before, but amx_help works. In other words it works but the 200-250 is 0.

So there is no way for amx_help to not see the commands? like say overall with uaio ther is 271 and then i block it it would say 200 instead of 271 and blocking 71 commands?
__________________
bmann_420 is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 12-01-2005 , 14:43  
Reply With Quote #9

I take care about displaying of right numbers a few days ago.
Just put commands that needed to be expluded from amx_help.
Sure i tested my code before posting it and it works.


EDIT:

Maybe we just not understand each other?
Can you post full command list or at least two commands that you want to exclude?
Just to make me sure i understand you correctly.
Is it something like amx_bury, amx_god?
VEN is offline
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 12-01-2005 , 15:11  
Reply With Quote #10

Code:
 33: amx_glow <authid, nick, @team or #userid> <red> <green> <blue> <alpha>  34: amx_god <nick | steam> - Sets a player to god mode  35: amx_godall - Sets all players to god mode  36: amx_godteam <team number | name> - Sets player on team to god mode  37: amx_gravity < gravity >  38: amx_heal <authid, nick, @team or #userid> <life to give>  39: amx_help <page> [nr of cmds (only for server)] - displays this help  40: amx_hpk - configures high_ping_kicker plugin  41: amx_invisible  <name> <1-on/0-off>  42: amx_isprite : Add new sprites to the map  43: amx_juggernaut_health  <Juggernaut's health> (Default 10,000)  44: amx_kick <name or #userid> [reason]  45: amx_kickmenu - displays kick menu  46: amx_leave <tag> [tag] [tag] [tag]  47: amx_llama - <authid, nick, @team or #userid>  48: amx_lockauto locks Auto Team  49: amx_lockct locks CT Team ----- Entries 1 - 50 of 271 ----- ----- Use 'amx_help 51' for more ----- ] amx_help 200 ----- AMX Mod X Help: Commands ----- ----- Entries 200 - 249 of 271 ----- ----- Use 'amx_help 250' for more ----- ] amx_help 250 ----- AMX Mod X Help: Commands -----   0: weaponarena <weaponnumber|off|list|random>   1: weaponarena_menu - displays Weapon Arena's menu   2: weaponarena_random <abcd...> [save] - Set what weapons will be available in random mode (this will override any previous s  3: weaponarena_randomlist - lists all weapons enabled for random mode ----- Entries 250 - 271 of 271 ----- -----

this is when it blocks
Code:
new const excluded[EXCLUDED_NUM][] = {     "uaio_",     "z",     "z" }

alli wanted it to block was uaio, and it blocks it now. but the 271 commands still shows up, but its not that big of a deal
__________________
bmann_420 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 16:02.


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