Legend Posted December 20, 2018 Posted December 20, 2018 (edited) Hi. When server started then running my script (and print good value(example: Retrieved 1 trashes)) but I connecting my server and object isn't seen. It's good if then execute my script when running the server. var cachedTrashes = []; function loadTrashes() { global.db.query("SELECT * FROM `trashes`", function(error, results, fields) { if(error) { console.log("error while retrieving trashes from mysql database! (" + error + ")"); } else { results.forEach(function(currElement) { let obj = mp.objects.new(mp.joaat("prop_bin_delpiero"), new mp.Vector3(parseFloat(currElement.x), parseFloat(currElement.y), parseFloat(currElement.z)), { rotation: 0.0, alpha: 255, dimension: parseInt(currElement.dim) }); obj.setVariable("inv:trash", true); cachedTrashes[parseInt(currElement.id)] = obj; }); console.log("Retrieved " + results.length + " trashes"); } }); } loadTrashes(); Please help me. Edit: If reconnected then I don't see again my server sided objects when I ran my script after server start. Edited December 20, 2018 by Legend
Flow Posted December 20, 2018 Posted December 20, 2018 coul be issue that some objects seem to be broken in meaning they don't shop up. I have some objects spawned which now are gone since last gta update.
Legend Posted December 20, 2018 Author Posted December 20, 2018 I tried search object in client sided but don't working. Object is not synchronization if then I created object when I not online.
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