GetMaxPlayers: Difference between revisions
Jump to navigation
Jump to search
Jack Johnson (talk | contribs) m (Shortened down the code) |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server function}} | {{Server function}} | ||
هذه الوظيفة تقوم بأحضار اقصي من الاعبين يسمح به في الخادم. | |||
==Syntax== | ==Syntax== | ||
Line 7: | Line 7: | ||
===Returns=== | ===Returns=== | ||
تحضر لك اقصي مسموح من الاعبين داخل السيرفر. | |||
==Example== | ==Example== | ||
This example outputs the current number of players together with the maximum number of players when a player joins. | This example outputs the current number of players together with the maximum number of players when a player joins. | ||
هذا المثال يخرج في الدردشة اقصي عدد للاعبين في الخادم مع العدد الحالي للاعبين في الخادم عند دخول الاعب. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function showPlayers() | function showPlayers() |
Revision as of 18:34, 18 February 2016
هذه الوظيفة تقوم بأحضار اقصي من الاعبين يسمح به في الخادم.
Syntax
int getMaxPlayers ()
Returns
تحضر لك اقصي مسموح من الاعبين داخل السيرفر.
Example
This example outputs the current number of players together with the maximum number of players when a player joins. هذا المثال يخرج في الدردشة اقصي عدد للاعبين في الخادم مع العدد الحالي للاعبين في الخادم عند دخول الاعب.
function showPlayers() outputChatBox("There are "..getPlayerCount().."/"..getMaxPlayers().." players playing.",source) --output a message to the joined player informing the player count and max players. end addEventHandler("onPlayerJoin",root,showPlayers) --Add an event handler to call the function when a player joins.
See Also
- getMaxPlayers
- getServerConfigSetting
- getServerHttpPort
- getServerName
- getServerPassword
- getServerPort
- isGlitchEnabled
- setGlitchEnabled
- setMaxPlayers
- setServerConfigSetting
- setServerPassword
- shutdown