GetFPSLimit: Difference between revisions
Jump to navigation
Jump to search
ThePiotrek (talk | contribs) mNo edit summary |
(Update example and fps range.) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{Server client function}} | {{Server client function}} | ||
__NOTOC__ | __NOTOC__ | ||
This function retrieves the maximum [http://en.wikipedia.org/wiki/Frame_rate FPS (Frames per second)] that players on the server can run their game at. | This function retrieves the maximum [http://en.wikipedia.org/wiki/Frame_rate FPS (Frames per second)] that players on the server can run their game at. | ||
{{Note| | |||
* Starting from version [[https://buildinfo.mtasa.com/?Revision=21313&Branch r21313]] and above '''fpsLimit''' range is '''25-32767'''. In older MTA releases it was '''25-100'''. | |||
}} | |||
==Syntax== | ==Syntax== | ||
Line 9: | Line 12: | ||
===Returns=== | ===Returns=== | ||
Returns an integer between '''25''' and ''' | Returns an integer between '''25''' and '''32767''' (refer to the note above) of the maximum FPS that players can run their game at. | ||
==Example== | ==Example== | ||
This example displays a message in the chatbox showing the current | This example displays a message in the chatbox showing the current FPS limit. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function | function checkFPSLimit() | ||
local fpsLimit = getFPSLimit() | |||
-- Add | outputChatBox("The FPS limit is: "..fpsLimit) | ||
end | |||
addCommandHandler("checkfpslimit", checkFPSLimit) -- Add command "checkfpslimit" which calls the function checkFPSLimit | |||
</syntaxhighlight> | </syntaxhighlight> | ||
[[pl:getFPSLimit]] | [[pl:getFPSLimit]] | ||
[[ru:getFPSLimit]] | |||
==See Also== | ==See Also== | ||
{{Server functions}} | {{Server functions}} |
Latest revision as of 22:03, 22 May 2023
This function retrieves the maximum FPS (Frames per second) that players on the server can run their game at.
Syntax
int getFPSLimit ()
Returns
Returns an integer between 25 and 32767 (refer to the note above) of the maximum FPS that players can run their game at.
Example
This example displays a message in the chatbox showing the current FPS limit.
function checkFPSLimit() local fpsLimit = getFPSLimit() outputChatBox("The FPS limit is: "..fpsLimit) end addCommandHandler("checkfpslimit", checkFPSLimit) -- Add command "checkfpslimit" which calls the function checkFPSLimit
See Also
- getMaxPlayers
- getServerConfigSetting
- getServerHttpPort
- getServerName
- getServerPassword
- getServerPort
- isGlitchEnabled
- setGlitchEnabled
- setMaxPlayers
- setServerConfigSetting
- setServerPassword
- shutdown