Jump to content

Question related to TriggerClient/Server(Event)


Hero192

Recommended Posts

Hello dear MTA Scripters,

Today I want to ask about trigger function,

I want to know in which case I have to set root and source/player to sourceElement arguments

Like ,

triggerClientEvent (getRootElement(), "eventName", getRootElement()) 

and in which case I have to use source or player

triggerClientEvent (source, "eventName" source ) 

and does that refer the same as triggerServerEvent ?

triggerServerEvent("eventName", getRootElement() ) 

I really need to understand that properly..

Thanks in advance.

Link to comment

I'm not sure about the source == getRootElement() but I can say that these two are the same;

triggerClientEvent ( source, "eventName", source ); 
triggerClientEvent ( "eventName", source, source );  

You might even be able to leave out the second source is the second line since that'll only push the playerElement in the parameters in your client.

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...