itHyperoX Posted December 20, 2017 Share 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) Link to comment
koragg Posted December 20, 2017 Share 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. Link to comment
itHyperoX Posted December 20, 2017 Author Share Posted December 20, 2017 I fixed it with another way. Link to comment
Moderators IIYAMA Posted December 21, 2017 Moderators Share 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 Link to comment
koragg Posted December 21, 2017 Share 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. Link to comment
LoPollo Posted December 21, 2017 Share 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 Link to comment
itHyperoX Posted December 21, 2017 Author Share 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 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