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 Jun 23, 2020
·
11 revisions
Events
We have 4 Types of Events
[MapEvents]
[PlayerEvents]
[ScpEvents]
[ServerEvent]
In order to use them add using Synapse.Events at the top and hook the Events from the Events class that you need.
Example:
using Synapse;
using Synapse.Events
namespace Example
{
public class Example : Plugin
{
public override void OnEnable()
{
Log.Info("Hello")
Events.PlayerJoinEvent += this.OnJoin;
}
public override string GetName => "YourPluginName";
public void OnJoin(ref PlayerJoinEvent ev)
{
//Here can you Execute code that will be activated when a Player join.In ev are all informations about the Event like The Player that joins = ev.Player
}
}
}