AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Can I register on chat a command that has an argument ? (https://forums.alliedmods.net/showthread.php?t=184077)

NucL3ra 04-30-2012 16:00

Can I register on chat a command that has an argument ?
 
As the title says, can I register a command that has one or more arguments WITHOUT hooking say

register_clcmd("top15", "Top15");

And when I type top15 , top15 www or top15 ab cd ef will actually call Top15 function

Doc-Holiday 04-30-2012 16:06

Quote:

Originally Posted by NucL3ra (Post 1699466)
As the title says, can I register a command that has one or more arguments WITHOUT hooking say

register_clcmd("top15", "Top15");

And when I type top15 , top15 www or top15 ab cd ef will actually call Top15 function

If your talking about say commands its all one large argument and you have to parse it to brake it up i think.

Unless you add more the one register clcmd not sure which method would be better but prolly the multiple cmds if they are all known

Exolent[jNr] 04-30-2012 16:07

Re: Can I register on chat a command that has an argument ?
 
If you mean hook "say top15 www" or "say top15 ab cd ef", then no you have to hook say.
If "top" is a console command, then yes you can.

NucL3ra 04-30-2012 16:26

Re: Can I register on chat a command that has an argument ?
 
I know it works on console, I'm sad I have to register say to do it for say messages.


All times are GMT -4. The time now is 07:41.

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