Laelon Posted August 19, 2019 Share Posted August 19, 2019 Hi there! I'm trying to get the SharedData for a Vehicle working. But it looks like the Data is not getting set. Maybe you can help! Server Code: [Command("veh")] public void CreateVehicle(Client player, string hash, int color1, int color2, string plate) { VehicleHash vehicleHash = NAPI.Util.VehicleNameToModel(hash); Vehicle vehicle = NAPI.Vehicle.CreateVehicle(vehicleHash, player.Position, 0, color1, color2); Random rnd = new Random(); int guid = rnd.Next(100000000, 999999999); vehicle.SetSharedData("VehicleGUID", guid); //DEBUG NAPI.Util.ConsoleOutput("GUID: " + vehicle.GetSharedData("VehicleGUID")); } Output: Link to comment Share on other sites More sharing options...
Xabi Posted August 19, 2019 Share Posted August 19, 2019 Setting shared data takes some time, maybe that could be the reason. Link to comment Share on other sites More sharing options...
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