itHyperoX Posted December 20, 2017 Posted December 20, 2017 Hi, i'm working on an airdrop system, almost everything done. I'm thinking about how can i trigger an effect to the server side? Because we have almost 60 players on the server, and i want that they all can see the smoke. I tried --server: function createSmoke(x, y, z) triggerClientEvent(getRootElement(), "createSmoke", getRootElement(), x, y, z) end addEvent("createSmoke", true) addEventHandler("createSmoke", getRootElement ( ), createSmoke) --client: function smokeCreate(x, y, z) smoke = createEffect("tank_fire", x, y, z, -90, 0, 0) setEffectSpeed(smoke, 4) end addEvent( "createSmoke", true ) addEventHandler( "createSmoke", resourceRoot, smokeCreate)
koragg Posted December 20, 2017 Posted December 20, 2017 Try to set the client event handler for 'root' as well instead of 'resourceRoot'. I had problems if it wasn't root recently. I love rock/metal/pop but don't mind any other music genre except чалга...that thing sux I also love cars PS I'm friendly
Moderators IIYAMA Posted December 21, 2017 Moderators Posted December 21, 2017 11 hours ago, koragg said: Try to set the client event handler for 'root' as well instead of 'resourceRoot'. I had problems if it wasn't root recently. That is because resourceRoot is a child of the root. But in this case the one that is accepted is the child and the one that is send is the parent. Childs do not accept parents, parents only accept childs or itself. But you already knew that didn't you? https://wiki.multitheftauto.com/wiki/File:Tre.png 2 Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
koragg Posted December 21, 2017 Posted December 21, 2017 @IIYAMA I'm studying trees in university and I hate it Haven't payed attention to that graph although I've seen it before. I love rock/metal/pop but don't mind any other music genre except чалга...that thing sux I also love cars PS I'm friendly
LoPollo Posted December 21, 2017 Posted December 21, 2017 (edited) @TheMOG isn't it better to trigger the event to a player table and bind the client-side to root/localPlayer? UNTESTED I remember triggering events on root isn't a good thing (i've not been around for some time, correct me if wrong) Edited December 21, 2017 by LoPollo Mobile keyboards suck
itHyperoX Posted December 21, 2017 Author Posted December 21, 2017 (edited) I already fixed it. Found a dff file on the community, downloaded, then attached the "object" to the airdrop. Edited December 21, 2017 by TheMOG
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