Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lua API to access vehicle data on the server #347

Open
JotaFaD opened this issue Jul 3, 2024 · 1 comment
Open

Lua API to access vehicle data on the server #347

JotaFaD opened this issue Jul 3, 2024 · 1 comment
Labels
feature New feature or request good first issue Good for newcomers

Comments

@JotaFaD
Copy link

JotaFaD commented Jul 3, 2024

Is your feature request related to a problem? Please describe.
I'm writing a mod that requires the server to save the player's position to a database periodically.

Currently, I have a timer on the client side mod that sends the position of the player to the server through events.

It works as expected, but I consider the extra event usage wasteful, as the server already must receive this data to transmit it to other clients (from my understanding, through MPGameNetwork), but a lua API to access this data (position, rotation, electrics...) doesn't seem to exist.

Describe the solution you'd like
Something like MP.getPlayerData(playerId).position to access the last position a specific client sent to the server.

Describe alternatives you've considered
Using events and transmitting the information through my own code.

Additional context
None.

@JotaFaD JotaFaD added the feature New feature or request label Jul 3, 2024
@Mack29446
Copy link
Contributor

Mack29446 commented Jul 3, 2024

Hey, this already mostly exists - see MP.GetPositionRaw 🙂 - although not including electrics

@lionkor lionkor added the good first issue Good for newcomers label Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants