ZEPHYR Posted October 19, 2017 Share Posted October 19, 2017 google translate started: I do not know how to run createWeapon through the server, so that other players see the created weapons and that their client scripts could perceive the action of this weapon. easier to say how to make synchronization for weapons between players? here are some similar scripts. I do not have my own script because I could not think of anything else. https://vk.com/away.php?to=http%3A%2F%2Fwww.mta-resource.ru%2Fforum%2Ftopic%2Fid%2F3292&el=snippet https://vk.com/away.php?utf=1&to=https%3A%2F%2Fforum.multitheftauto.com%2Ftopic%2F55963-createweapon%2F I only have a position for weapon: local m1 = createWeapon("minigun", x, y, z) local m2 = createWeapon("minigun", x, y, z) attachElements ( m1, Vehicle, 0.34, 1, 0.55, -2, 30, 95) attachElements ( m2, Vehicle, 0.7, 1, 0.55, -2, 30, 95) setWeaponProperty(m1, "fire_rotation", 0, -30, -5) setWeaponProperty(m2, "fire_rotation", 0, -30, -5) Link to comment
NanoBob Posted October 20, 2017 Share Posted October 20, 2017 What you would do is have a table on the server side, with all the created weapons. When a player join the game, and on creation of the weapon you would use triggerClientEvent() to create the weapon for all clients that do not yet have it. FUrthermore in order to synchronise them you would have to make sure the functions are executed on all clients, this can be done using triggerClientEvent. (If you want to sync from 1 client to all other clients you will have to triggerServerEvent first, and from there on triggerClientEvent to every client (except the original sender) Link to comment
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