Jump to content

Triggering Effect


itHyperoX

Recommended Posts

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
  • Moderators
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

  • Like 2
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...