Jump to content

onClientResourceStart


Link2012

Recommended Posts

You didn't understand, really (I expected I didn't had to say that doStuff and doMoreStuff are pseudo-funcs)

What I mean is, what's the difference between putting my functions\commands\whatever_I_Want_To_Do in onClientResourceStart and on the "main part" of the lua file, since the "main part" of the lua file has started, it means that the resource started, right?

Link to comment
You didn't understand, really (I expected I didn't had to say that doStuff and doMoreStuff are pseudo-funcs)

What I mean is, what's the difference between putting my functions\commands\whatever_I_Want_To_Do in onClientResourceStart and on the "main part" of the lua file, since the "main part" of the lua file has started, it means that the resource started, right?

yes , event 'onClientResourceStart' is triggered when the resource starts to run

and these 2 functions will be happened when the resource starts ..

Link to comment

I explained it long time ago, viewtopic.php?f=91&t=23895&p=289200#p289183

In addition, if you want the script to work properly use events. If you don't and the script doesn't work then ask yourself why and remind yourself I suggested to use events. The difference is that on(Client)ResourceStart get triggered only when all the scripts within the resource get executed. If you're calling a function from a different file and that file hasn't started yet then your script will fail because it doesn't know about existence of that function. This is why you should use the event to be safe.

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