You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GrafDimenzio edited this page Dec 21, 2020
·
5 revisions
SynapseCommand
If you want to create a custom command, that's easy!
You only need to create a new class in your project, let this Class inherit from ISynapseCommand and add the needed CommandInformation and you are done.
Synapse will do the rest 😄
In the method Execute(), you can then use Synapse as normal.
Example:
usingSynapse.Command;usingSystem.Linq;namespaceCommandPlugin{[CommandInformation(Name="hello",// The main name and parameter for your commandAliases=newstring[]{"helloworld"},// Aliases you can use instead of main commandDescription="A Hello World Command",// A Description for the CommadPermission="commandplugin.hello",// The permission which the player needs to execute the CommandPlatforms=new[]{Platform.RemoteAdmin,Platform.ServerConsole},// The platforms the command can be usedUsage="Just type hello or helloworld in the Console!"// A message how to use the command)]publicclassHelloWorldCommand:ISynapseCommand{publicCommandResultExecute(CommandContextcontext){varresult=newCommandResult();result.Message="Hello World";result.State=CommandResultState.Ok;returnresult;}}}