StartPackage: Difference between revisions

From Onset Developer Wiki
(Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|Start a package during runtime. If the package contains client files, they will be downloaded during the game.}} {{FuncSyntax|...")
 
No edit summary
Line 11: Line 11:


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua">
function cmd_restartpack(player, package_)
StopPackage(package_)
 
Delay(500, function()
StartPackage(package_)
end)
end
AddCommand("restartpack", cmd_restartpack)
</syntaxhighlight>
 


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
__EDIT_ME__

Revision as of 20:24, 13 November 2019

StartPackage

Type: Function
Context: Server
Introduced: v1.0

Description

Start a package during runtime. If the package contains client files, they will be downloaded during the game.

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

__EDIT_ME__