ihatetn931 Posted April 11, 2019 Share Posted April 11, 2019 (edited) This is prolly a stupid question but how do you use csharp onClientEventTrigger these days, I've searched for several hours and gave up now a few days later here I am trying to figure it out again. Edited April 11, 2019 by ihatetn931 typos Link to comment Share on other sites More sharing options...
Soul Posted April 11, 2019 Share Posted April 11, 2019 (edited) Serverside: NAPI.ClientEvent.TriggerClientEvent(client, "name_of_the_event"); Clientside: // Constructor of some class. public MyClass() { RAGE.Events.Add("name_of_the_event", eventHandlerFunction); // eventHandlerFunction is just a placeholder name, you name it RAGE.Events.Add("name_another_event", anotherEventHandler); } public void eventHanderFunction(object[] args) { /* * CODE TO EXECUTE WHEN THE EVENT GETS TRIGGERED */ Events.CallRemote("name_of_server_event"); // This is the way you trigger server events, from clientside } Example of Remote event (Called from client) [RemoteEvent("name_of_server_event")] public void functionHandlerName(Client client, int sex) { /* * CODE TO EXECUTE ON TRIGGER */ } Hope this helps. There are tutorials on this forum about this already Edited April 11, 2019 by Soul Link to comment Share on other sites More sharing options...
ihatetn931 Posted April 11, 2019 Author Share Posted April 11, 2019 Thank you for the reply, I guess I didn't find them cause they didn't show in a google search. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now