Skip to the content.

FxEvents: An Advanced Event Subsystem for FiveM

FxEvents is a powerful event system for FiveM, providing robust features for event handling with an emphasis on security and ease of use. Whether you’re building multiplayer scripts or custom client-server communication systems, FxEvents offers powerful features to enhance your development workflow.

Features

1. Robust Event Handling

2. Automatic Event Initialization (v3.0.0+)

3. Advanced Event Mounting

4. Encryption and Anti-Tamper Features

5. Native ValueTuple Support

6. Server and Client-Side Event Triggering

7. Event Binding Options (v3.0.0+)

8. Support for FiveM Types

9. Callbacks and Response Handling

10. Serialization Features

11. Easy Debugging and Customization

12. Community and Support

Usage Example

To integrate FxEvents into your project, you’ll need to initialize it first and mount events for your specific use cases. Below is an example of how to get started:

Initialize FxEvents:

public class Main : BaseScript
{
    public Main()
    {
        // Initialize the FxEvents library. Call this once at script start to enable EventHub usage anywhere.
        EventHub.Initialize();
    }
}

Mounting an Event:

EventHub.Mount("eventName", Binding.All, new Action<ISource, string, int>(([FromSource] source, string val1, int val2) =>    
{
    // Code to execute inside the event.
    Logger.Info($"Event triggered with values: {val1}, {val2}");
}));

Conclusion

FxEvents provides a comprehensive, flexible, and secure event-handling system for FiveM developers. With its advanced features such as encryption, MsgPack serialization, and anti-tampering, it ensures efficient and safe communication across client-server boundaries in multiplayer environments.


For full documentation and support or to contribute, visit the FxEvents GitHub page or join the community via Discord.