ozinhobr 3 Posted August 8, 2020 Share Posted August 8, 2020 (edited) How to pass parameters from Server to Client? I want to pass the result of a search in MySQL. Edited August 8, 2020 by ozinhobr Link to post Share on other sites
randzhamiya 5 Posted August 8, 2020 Share Posted August 8, 2020 (edited) https://wiki.rage.mp/index.php?title=Getting_Started_with_Entity_variables or https://wiki.rage.mp/index.php?title=Getting_Started_with_Events Edited August 8, 2020 by randzhamiya 1 Link to post Share on other sites
mZentorno 2 Posted August 8, 2020 Share Posted August 8, 2020 to send to specific player client : https://wiki.rage.mp/index.php?title=Player::call to send to all clients : https://wiki.rage.mp/index.php?title=Players::calland to receive the data: https://wiki.rage.mp/index.php?title=Events::add 1 Link to post Share on other sites
ozinhobr 3 Posted August 8, 2020 Author Share Posted August 8, 2020 Thanks guys, I will pay more attention next time, I managed to solve the problem in a simple way, after many hours. I was saving the hair in the database, I called the event at the time I needed it and when the user enters the character he changes the hair according to the database. mp.events.add("hairIde", function (player, idTest) { connection.query("SELECT hairID FROM char_test WHERE user_login = ?", [player.socialClub], function (e, results) { if (results.length > 0) { Object.keys(results).forEach(function (key) { let row = results[key]; idTeste = row.hairID; player.setClothes(2, idTest, 0, 2); }); } else { console.log("nao funciona"); } }); }); 😅 1 Link to post Share on other sites
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