Jump to content
RAGE Multiplayer Community

Player Synced Data


linnik
 Share

Recommended Posts

3 часа назад, Xabi сказал:
Цитата

mp.players.local.vehicle.getEntitySharedData("name")

getEntitySharedData is not a function.

 

Server:

Цитата

Vehicle.setEntitySharedData("name", "123");

 

Edited by linnik
Link to comment
Share on other sites

7 minutes ago, linnik said:

getEntitySharedData is not a function.

 

Server:

 

Because what he linked you is C# seeing as you said you moved from GT-MP. SetVariable/getVariable is what you want if you’re using Javascript

https://wiki.rage.mp/index.php?title=Entity::setVariable

https://wiki.rage.mp/index.php?title=Entity::getVariable

just so you know setVariable is serverside only, getVariable is both client and serverside

  • Like 1
Link to comment
Share on other sites

Только что, MrPancakers сказал:

Because what he linked you is C# seeing as you said you moved from GT-MP. SetVariable/getVariable is what you want if you’re using Javascript

https://wiki.rage.mp/index.php?title=Entity::setVariable

https://wiki.rage.mp/index.php?title=Entity::getVariable

just so you know setVariable is serverside only, getVariable is both client and serverside

Thx a lot.

Link to comment
Share on other sites

  • 1 year later...

How can i create variables for all vehicles at the server start?

global.KocsiCsomagtartok = function()
{
  mp.vehicles.forEach((vehicleid=> {
    vid = vehicle.id;
    vehicle.setVariable("Material"0);
    //vid.setVariable("Marihuana", 15);
    //vid.setVariable('Material', 5);
    console.log(`Kocsi ideiglenes csomagtartok lekrealva ${vehicle} ${vid}`);
  });
}
Link to comment
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
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...