No event handlers for Client Side - C#


#1

Hello, for some odd reason the CitizenFX.Core does not provide any references for Event Handling on client side like said on wiki. Can someone enlighten me on the issue? Code below comes back saying EventHandlers does not exist.

using System.Threading.Tasks;
using CitizenFX.Core;
using CitizenFX.Core.Native;
using CitizenFX.Core.UI;

namespace ZombiesClient
{
    public class ZombiesClient
    {
        public ZombiesClient()
        {
            EventHandlers.Add("chatMessage", new Action<string>(OnMessage));
        }
    }
}


#2

Your ZombiesClient class needs to inherit from BaseScript, like this:

public class ZombiesClient : BaseScript
{

}

#3

Wow, I feel like an idiot, thanks. Haven’t slept in a while.