OnPackageStart: Difference between revisions

From Onset Developer Wiki
Created page with "{{Info|Event|Server|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|OnPackageStart}} {{FuncParameters}} == Example == __EDIT_ME__ {{RelatedFunctions}} {{ServerEvents}}"
 
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Info|Event|Server|1.0}}
{{Info|Event|Server & Client|1.0}}


{{FuncDescription|__EDIT_ME__}}
{{FuncDescription|Package was started and its scripts loaded. Use this event to initialize your script. For instance connecting to a database.}}


{{FuncSyntax|OnPackageStart}}
{{FuncSyntax|OnPackageStart()}}


{{FuncParameters}}
== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua">
local function OnPackageStart()
print(GetPackageName().." started")
end
AddEvent("OnPackageStart", OnPackageStart)
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
{{ServerEvents}}
{{PackageEvents}}

Latest revision as of 14:49, 27 January 2020

OnPackageStart

Type: Event
Context: Server & Client
Introduced: v1.0

Description

Package was started and its scripts loaded. Use this event to initialize your script. For instance connecting to a database.

Syntax

OnPackageStart()

Example

local function OnPackageStart()
	print(GetPackageName().." started")
end
AddEvent("OnPackageStart", OnPackageStart)

See also