Scripting Posted April 14, 2012 Share Posted April 14, 2012 tiggerClientEvent don t work! server-side: addEventHandler("onResourceStart",root, function () triggerClientEvent ( 'startTheClient',source ) end ) Link to comment
drk Posted April 14, 2012 Share Posted April 14, 2012 Will never work because you're triggering an event for the started resource. Link to comment
unknooooown Posted April 14, 2012 Share Posted April 14, 2012 tiggerClientEvent don t work!server-side: addEventHandler("onResourceStart",root, function () triggerClientEvent ( 'startTheClient',source ) end ) Exactly what are you trying to do here? When you use 'onResourceStart' the source of that event is the resource that started. So you can't triggerClientEvent for players if thats what you are trying to do. "The source of this event is the root element in the resource that started." From: https://wiki.multitheftauto.com/wiki/OnResourceStart If you want to trigger a clientEvnet for all players when the resource starts, do could do: addEventHandler("onResourceStart",root, function () for i,player in ipairs( getElementsByType( "player" ) ) do triggerClientEvent ( player, 'startTheClient', player ) end end) You should also take a look at: https://wiki.multitheftauto.com/wiki/OnC ... ourceStart 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