GTA Connected

General => Suggestions => Archive => Topic started by: Vortrex on October 10, 2018, 05:53:55 AM

Title: Allow "client" when setting element.syncer.
Post by: Vortrex on October 10, 2018, 05:53:55 AM
Currently when setting an element syncer manually via server scripts, you have to use a client's ID as syncer.

Example: element.syncer = clientID
Right now the only way to get a client's ID is through a loop of all connected clients (terrible!) ... I figured it'd be nice to allow something like: element.syncer = client
An very basic example, in JavaScript:
addNetworkHandler("my_car", function(client, vehicle) {
vehicle.syncer = client;
});
Title: Re: Allow "client" when setting element.syncer.
Post by: Vortrex on August 26, 2021, 12:06:43 AM
So client.index is available now but it's still inconsistent with the other uses for syncer.

For example, when triggering a network event for an element's syncer you use the client object itself in the args (meaning you still have to use a loop to get which client's index matches element.syncer), but when setting it's syncer you have to use the client's index instead.
Title: Re: Allow "client" when setting element.syncer.
Post by: Vortrex on April 19, 2022, 08:23:52 PM
This has been added and awaiting the next update.
Topic closed.