Replace words in console
I know how to replace letters in chat. But i need to know how to replace letters or words in console such that if someone writes
amxx in console it replaces it to amx, (not what i'm planning to do but still) +Karma to the one who helps |
Same way as you replace letters in chat.
|
Example ;)
|
Just check for certain words in client_command. Use read_argv(0, and read_args to retrieve full command line, then replace what needed with replace_all, then send modified command with client_cmd and block original with return PLUGIN_HANDLED. If you've changed say text, this shouldn't be a problem for you.
|
you are trying to make shortcuts for console admin commands? if you give a real example people will be able to help instead of giving us some generic example that isn't what you want to do.
|
GHW Chronic 915 (2:09:36 PM): maybe tell me wtf ur talking about
Rcowzy (2:10:02 PM): Ok Rcowzy (2:10:11 PM): so don't you hate it when you have caps lock on Rcowzy (2:10:17 PM): and you type AMX_MAP DE_DUST2 Rcowzy (2:10:27 PM): and console goes like: MAn WTF AMX_MAP isn't a command Rcowzy (2:10:36 PM): and you wanna say ...... YEAH GIRL, FUCK ME HARD Rcowzy (2:10:51 PM): so with my plugin it changes A to a, B to b, C to c Rcowzy (2:11:03 PM): to avoid that stupid ass error |
Code:
/* Called when client is sending command. */Or an even more accurate way would be to get a full list of commands into an array, and then match against the array using equali and then sedn the exact right command. |
Why you changes A to a, B to b, C to c? Better change "AMX_MAP" to "amx_map"! Use strtolower function.
|
| All times are GMT -4. The time now is 08:00. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.