linnik Posted July 8, 2018 Posted July 8, 2018 (edited) Hi guys, I haven't found any function that shares data between server and client. I moved from GT-MP where I had had setEntitySyncedData. Edited July 8, 2018 by linnik
Xabi Posted July 8, 2018 Posted July 8, 2018 It's called EntitySharedData on RAGE Multiplayer: https://wiki.gtanet.work/index.php?title=SetEntitySharedData https://wiki.gtanet.work/index.php?title=GetEntitySharedData https://wiki.gtanet.work/index.php?title=ResetEntitySharedData 1
linnik Posted July 8, 2018 Author Posted July 8, 2018 (edited) 3 часа назад, Xabi сказал: It's called EntitySharedData on RAGE Multiplayer: https://wiki.gtanet.work/index.php?title=SetEntitySharedData https://wiki.gtanet.work/index.php?title=GetEntitySharedData https://wiki.gtanet.work/index.php?title=ResetEntitySharedData Цитата mp.players.local.vehicle.getEntitySharedData("name") getEntitySharedData is not a function. Server: Цитата Vehicle.setEntitySharedData("name", "123"); Edited July 8, 2018 by linnik
MrPancakers Posted July 8, 2018 Posted July 8, 2018 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 1
linnik Posted July 8, 2018 Author Posted July 8, 2018 Только что, 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.
Freamee Posted October 19, 2019 Posted October 19, 2019 How can i create variables for all vehicles at the server start? global.KocsiCsomagtartok = function() { mp.vehicles.forEach((vehicle, id) => { vid = vehicle.id; vehicle.setVariable("Material", 0); //vid.setVariable("Marihuana", 15); //vid.setVariable('Material', 5); console.log(`Kocsi ideiglenes csomagtartok lekrealva ${vehicle} ${vid}`); }); }
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now