Jump to content

Search the Community

Showing results for tags 'remoteevent'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • RAGE Multiplayer
    • Announcements
    • Discussion
    • Suggestions
  • Scripting
    • Scripting
    • Resources
  • Community
    • Support
    • Servers
    • Media Gallery
  • Non-English
    • Русский - Russian
    • Français - French
    • Deutsch - German
    • Espanol - Spanish
    • Română - Romanian
    • Portuguesa - Portuguese
    • Polski - Polish

Categories

  • Scripts
  • Gamemodes
  • Libraries
  • Plugins
  • Maps
  • Tools

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Facebook


Youtube


Skype


Web


VK

Found 1 result

  1. A similar but official and better system has been integrated into RageMP. To initialize at startup Call this anywhere public MainClass() : Script { //call before any events public MainClass() { RageEventHelper helper = new RageEventHelper(); } } Usage 1. Copy and paste the spoiler code in a new .cs file (Make sure to use needed libraries like LINQ) 2. See example below Notes 1. You are responsible for properly delegating every event at startup. Look in the example below. Only do this once in the main script file and you are set. 2. Events must be public static void methods Example (How to delegate the events properly at startup) public class MainClass : Script { public MainClass() { RageEventHelper helper = new RageEventHelper(); Event.OnPlayerEnterVehicleAttempt += OnPlayerEnterVehicleAttempt; Event.OnUpdate += OnUpdate; } public void OnPlayerEnterVehicleAttempt(Client player, Vehicle veh, sbyte seat) { RageEventExtender.InvokeAllMethods<OnPlayerEnterVehicleAttemptEvent>(RageEventExtender.OnPlayerEnterVehicleAttemptEvents, player, veh, seat); } public void OnUpdate() { RageEventExtender.InvokeAllMethods<OnUpdateEvent>(RageEventExtender.OnUpdateEvents, null); } } In another file (How to use the events) public class AnotherClass { [OnPlayerEnterVehicleAttempt] public static void OnEnterAttempt(Client player, Vehicle veh, sbyte seat) { //enter } [OnUpdate] public static void OnUpdateThing() { //update } }
×
×
  • Create New...