SetServerName: Difference between revisions
From Onset Developer Wiki
No edit summary |
FlyingFork (talk | contribs) No edit summary |
||
Line 11: | Line 11: | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua> | |||
local servername = "Onset Server" | |||
local max = GetMaxPlayers() | |||
AddEvent("OnPlayerJoin", function() | |||
SetServerName("[" .. GetPlayerCount() .. "/" .. max .. "] " .. servername) | |||
end) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
* [[GetServerName]] | * [[GetServerName]] |
Latest revision as of 14:21, 26 June 2021
Description
Sets the display name of the server.
Syntax
SetServerName(ServerName)
Parameters
- ServerName
The name of the server.
Return Value
- This function doesn't return a value.
Example
local servername = "Onset Server"
local max = GetMaxPlayers()
AddEvent("OnPlayerJoin", function()
SetServerName("[" .. GetPlayerCount() .. "/" .. max .. "] " .. servername)
end)