Check client command
how to check a client command?
example.. i want to know player have or haven't a command call "Apple" now..i put this in my code.. PHP Code:
Check PlayerA , PlayerA doesn't have the command, so he get "Unknow Command" in the console //true Check PlayerB , PlayerB has the command,but it is nothing in the value <Apple ""> //false Check PlayerC , PlayerC has the command, and the value is<Apple "Orange">//false how can i get true or false? sorry for my very very poor english.. |
Re: Check client command
PHP Code:
PHP Code:
|
Re: Check client command
If you mean checking client's aliases, you can't, otherwise, client commands are handled server-side, with a few exceptions (connect, disconnect, etc)
|
Re: Check client command
It actually is possible... I made this check with statsme a long time ago... you CAN check whenever a player uses an unknown command but CANNOT check if a player has a command that is aliased... or... you could... by sending it and expect unknown command, if you receive it, it's not set, if not, it's aliased :lol:
don't really remember how I did it tough, I'll search through my old scripts and see what I can find :P EDIT: yeah, was something like hooking TextMsg and checking argument 2 with "#Game_unknown_command"... or something :lol: :P EDIT #2: tested a code and works, gets user ID and the unknown command sent: PHP Code:
|
Re: Check client command
Quote:
i compile the code PHP Code:
|
Re: Check client command
and to me it says ""PlayerA - unknow command: textMsg"
ps - so with hlguard on this thing gonna spam like hell? =\ but it works, lol at people who said it is impossible to see what is going on in player's console +_+ |
Re: Check client command
Quote:
|
Re: Check client command
Why not just register_clcmd() the command, and run it using client_cmd? If the callback is executed the command is not aliased, if it's not, it is.
|
Re: Check client command
that's odd... when I tested that code it worked :| showed my player ID and the command sent... now it doesn't... zomfg :|
|
Re: Check client command
i think it needs a read_data() func to show unknown command
|
| All times are GMT -4. The time now is 08:55. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.