GetGameVersionString: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|GetGameVersionString()}} {{FuncParameters}} {{FuncNoParam}} {{FuncReturnValue|__EDIT_ME__}} == E..." |
No edit summary |
||
Line 1: | Line 1: | ||
{{Info|Function|Server|1.0}} | {{Info|Function|Server & Client|1.0}} | ||
{{FuncDescription| | {{FuncDescription|Returns the server/ client's game version as a string.}} | ||
{{FuncSyntax|GetGameVersionString()}} | {{FuncSyntax|GetGameVersionString()}} | ||
Line 8: | Line 8: | ||
{{FuncNoParam}} | {{FuncNoParam}} | ||
{{FuncReturnValue| | {{FuncReturnValue|Returns the game version as a string.}} | ||
== Example == | == Example == | ||
'''Client:''' | |||
<syntaxhighlight lang="Lua"> | |||
local function OnPackageStart() | |||
AddPlayerChat("Your game version is: "..GetGameVersionString()) | |||
end | |||
AddEvent("OnPackageStart", OnPackageStart) | |||
</syntaxhighlight> | |||
'''Server:''' | |||
<syntaxhighlight lang="Lua"> | |||
local function OnPlayerJoin(player) | |||
AddPlayerChat(player, "This server runs on game version: "..GetGameVersionString()) | |||
end | |||
AddEvent("OnPlayerJoin", OnPlayerJoin) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
* [[GetGameVersion]] |
Latest revision as of 14:07, 25 January 2020
Description
Returns the server/ client's game version as a string.
Syntax
GetGameVersionString()
Parameters
- This function has no parameters.
Return Value
- Returns the game version as a string.
Example
Client:
local function OnPackageStart()
AddPlayerChat("Your game version is: "..GetGameVersionString())
end
AddEvent("OnPackageStart", OnPackageStart)
Server:
local function OnPlayerJoin(player)
AddPlayerChat(player, "This server runs on game version: "..GetGameVersionString())
end
AddEvent("OnPlayerJoin", OnPlayerJoin)