Page 1 of 1

problems with registerChatCommand...

Posted: 29 Dec 2010, 23:44
by reaby
i opened an issue to google code.. there is no way currently to use registerChatCommand to enter multiple words of as parameter into one variable. let's say i want to write personalmessage plugin or googletranslate... only way currently is to hookup to onPlayerChat and parse it by hand, which i think is kinda stupid.

*edit*

and maybe you could remove casesensitivity of chat command --> real command, as ppl in trackmania doesn't care much of case sensitivity on commands.

*edit2*

hmm.. the chatcommand fails to trigger if parameter count is not right.. says command *xx* doesn't exists try /help to see list...

How on earth i'm going to implement a plugin with selectable content, /gg should take either 0 or 1 parameters. 0 for general congratulations and 1 for player login.

Re: problems with registerChatCommand...

Posted: 30 Dec 2010, 07:39
by farfa
You just have to register 2 commands with the same callback. To work your callback method should have a default parameter.
For the parameters count, we'll maybe do something for this, but it's not a priority.