GetGameVersion: Difference between revisions

From Onset Developer Wiki
Justus (talk | contribs)
No edit summary
Line 8: Line 8:
{{FuncNoParam}}
{{FuncNoParam}}


{{FuncReturnValue|Returns the server/ client's game version}}
{{FuncReturnValue|Returns the server/ client's game version. 1st return value is the version as an integer, the 2nd return value is the version as a string.}}


== Example ==
== Example ==

Revision as of 13:02, 21 January 2020

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. 1st return value is the version as an integer, the 2nd return value is the version as a string.

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