zuloocart.blogg.se

Bzflag gu plugin
Bzflag gu plugin






bzflag gu plugin

To register a custom slash command called "mycommand", we call the bz_registerCustomSlashCommand() function inside of our plug-in's Init() function. We must tell BZFS that we'll be creating a custom command so the server knows that when this custom command is executed, it is forwarded to our plug-in instead of having the server attempt to handle an unknown command. Keep your slash commands easy to remember.Slash commands names cannot have spaces.Don't accidentally override existing slash commands.When coming up with your custom slash commands, there are few things that you should keep in mind: Registering the Slash Command to "Registering the Slash Command" section params - A list of the parameters given to the command parameters are split by spaces and respects quotes.Notice carefully that only the variable name is commented out and not the data type. This parameter is commented out in order to prevent compiler warnings of unused variables since message is rarely used. message - The slash command and all of the parameters together as a string.command - The command that was executed (this is useful when you register more than one command).playerID - The ID of the player who executed the slash command.You may wish to create a separate class dedicated to handling slash command logic but I prefer keeping things together so this chapter will keep things in one class.īy extending bz_CustomSlashCommandHandler, we're required to implement the following virtual function: virtual bool SlashCommand ( int playerID, bz_ApiString command, bz_ApiString /*message*/, bz_APIStringList *params)

bzflag gu plugin

Heads up! This is an opinionated approach where all the logic is in one class. Extending a Class to "Extending a Class" sectionĪs mentioned in the first chapter, our plug-ins will always extend the bz_Plugin class but in order to implement slash commands, we must extend one more class: bz_CustomSlashCommandHandler.

#BZFLAG GU PLUGIN GENERATOR#

Once again, I'll be using my plug-in generator to take care of all the generation and set up. Registering custom slash commands is pretty easy once you've got the hang of things and understand what is going on. Slash Commands to "Slash Commands" section Don't worry, like always, we'll be going step by step.

bzflag gu plugin

Today, we'll be talking about slash commands. Me, because I've been able to write this on a weekly basis without missing a day thus far. We've both made it to chapter 3 we should be proud. Interstellar space pirate extraordinaire








Bzflag gu plugin