Jump to content
RAGE Multiplayer Community

Client-server communication


Recommended Posts

  • 4 weeks later...

@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
Link to post
Share on other sites
  • 2 months later...
В 17.12.2019 в 20:11, mbsnero сказал:
// Client Side
mp.events.callRemote("sendDataToServer", data);

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

 

//client
mp.events.callRemote("PlayerData", player);
mp.gui.chat.push(player.age);
//server
mp.events.add({
    'PlayerData' : player => {
        player.age = "test"
    });

So?

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...