Modding:Commands: Difference between revisions

From Vintage Story Wiki
m
Grammar
No edit summary
m (Grammar)
Line 19: Line 19:
</syntaxhighlight>
</syntaxhighlight>


Commands are processed by the server, so our mod only needs to load on server side:
Commands are processed by the server, so our mod only needs to load on the server's side:
<syntaxhighlight lang="c#">
<syntaxhighlight lang="c#">
         public override bool ShouldLoad(EnumAppSide side)
         public override bool ShouldLoad(EnumAppSide side)
Line 40: Line 40:
</syntaxhighlight>
</syntaxhighlight>


This command can be used by any player which is allowed to send a message (by default everyone). Once a player will type in <code>/here</code> this command will be executed. Now we the only thing missing is the actual code to spawn particles and to player the sound.
This command can be used by any player who is allowed to send a message (by default everyone). When a player types in <code>/here</code>, the command will be executed. Now we the only thing missing is the actual code to spawn particles and to play the sound.


<syntaxhighlight lang="c#">
<syntaxhighlight lang="c#">
Line 72: Line 72:
== Testing ==
== Testing ==


Finally we are ready to run our first test:
Finally, we are ready to run our first test:


<youtube>XjHMtl6rSF4</youtube>
<youtube>XjHMtl6rSF4</youtube>
14

edits