Sign in to follow this  
Remmi_Jefferson

Client-server communication

Recommended Posts

// Client Side
mp.events.callRemote("sendDataToServer", data);

// Server Side
mp.events.add("sendDataToServer", function (player, data) {
  // Something do with data & player variables
});

 

  • Mask 1

Share this post


Link to post
Share on other sites
Posted (edited)

@Remmi_Jefferson

I'll be talking in the context of C# methods.

From Client > Server you need to use RAGE.Events.CallRemote(eventName, parameters). In the server-side have a [RemoteEvent] which calls a delegated callback and do the functions there with the parameters.

Edited by $kylar
  • Mask 1

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.