GetGameVersion: Difference between revisions
From Onset Developer Wiki
No edit summary |
|||
Line 11: | Line 11: | ||
== Example == | == Example == | ||
'''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}} | ||
* [[GetGameVersionString]] |
Revision as of 18:31, 19 December 2019
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)