GetGameVersion: Difference between revisions

From Onset Developer Wiki
28days (talk | contribs)
No edit summary
Justus (talk | contribs)
Line 11: Line 11:


== Example ==
== Example ==
__EDIT_ME__
'''Client:'''
<syntaxhighlight lang="Lua">
local function OnPackageStart()
    AddPlayerChat("Your game version is: "..GetGameVersion())
end
AddEvent("OnPackageStart", OnPackageStart)
</syntaxhighlight>
 
'''Server:'''
<syntaxhighlight lang="Lua">
local function OnPlayerJoin(player)
AddPlayerChat(player, "This server runs on game version: "..GetGameVersion())
end
AddEvent("OnPlayerJoin", OnPlayerJoin)
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
* [[GetGameVersionString]]

Revision as of 18:31, 19 December 2019

GetGameVersion

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

Description

Returns the server/ client's game version

Syntax

GetGameVersion()

Parameters

  • This function has no parameters.

Return Value

  • Returns the server/ client's game version

Example

Client:

local function OnPackageStart()
    AddPlayerChat("Your game version is: "..GetGameVersion())
end
AddEvent("OnPackageStart", OnPackageStart)

Server:

local function OnPlayerJoin(player)
	AddPlayerChat(player, "This server runs on game version: "..GetGameVersion())
end
AddEvent("OnPlayerJoin", OnPlayerJoin)

See also