StartPackage: Difference between revisions

From Onset Developer Wiki
Kuzkay (talk | contribs)
No edit summary
No edit summary
Line 1: Line 1:
{{Info|Function|Server|1.0}}
{{Info|Function|Server|1.0}}


{{FuncDescription|Start a package during runtime. If the package contains client files, they will be downloaded during the game.}}
{{FuncDescription|Starts a package at runtime. The game will automatically handle downloads for new client files.}}


{{FuncSyntax|StartPackage(PackageName)}}
{{FuncSyntax|StartPackage(PackageName)}}
Line 21: Line 21:
AddCommand("restartpack", cmd_restartpack)
AddCommand("restartpack", cmd_restartpack)
</syntaxhighlight>
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
*[[ImportPackage]]
*[[StartPackage]]
*[[StopPackage]]
*[[GetAllPackages]]
*[[GetPackageName]]
*[[IsPackageStarted]]

Revision as of 18:43, 30 August 2020

StartPackage

Type: Function
Context: Server
Introduced: v1.0

Description

Starts a package at runtime. The game will automatically handle downloads for new client files.

Syntax

StartPackage(PackageName)

Parameters

  • PackageName
    The name of the package.

Return Value

  • Returns true on success.

Example

function cmd_restartpack(player, package_)
	StopPackage(package_)

	Delay(500, function()
		StartPackage(package_)
	end)
end
AddCommand("restartpack", cmd_restartpack)

See also