Skip to content
This repository was archived by the owner on Sep 12, 2020. It is now read-only.
GrafDimenzio edited this page Jun 23, 2020 · 11 revisions

Events

We have 4 Types of Events

  1. [MapEvents]

  2. [PlayerEvents]

  3. [ScpEvents]

  4. [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
        }
    }
}

Clone this wiki locally