GetPackageName

From Onset Developer Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
GetPackageName

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

Description

Get name of the package from where this function is called from.

Syntax

GetPackageName()

Parameters

  • This function has no parameters.

Return Value

  • Returns the package name as a string.

Example

function OnPackageStart()
	WebGuiId = CreateWebUI(0.0, 0.0, 0.0, 0.0, 4, 32)
	LoadWebFile(WebGuiId, "http://asset/"..GetPackageName().."/gui/gui.html")
	SetWebAlignment(WebGuiId, 0.0, 0.0)
	SetWebAnchors(WebGuiId, 0.0, 0.0, 1.0, 1.0)
	SetWebVisibility(WebGuiId, WEB_HITINVISIBLE)
end
AddEvent("OnPackageStart", OnPackageStart)

See also