GetFPSLimit: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(New page: {{Server function}} __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. ==S...)
 
(Update example and fps range.)
 
(9 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Server 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 '''100''' of the maximum FPS that players can run their game at.
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 page lacks an example.
This example displays a message in the chatbox showing the current FPS limit.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--add an example here
function checkFPSLimit()
local fpsLimit = getFPSLimit()
 
outputChatBox("The FPS limit is: "..fpsLimit)
end
addCommandHandler("checkfpslimit", checkFPSLimit) -- Add command "checkfpslimit" which calls the function checkFPSLimit
</syntaxhighlight>
</syntaxhighlight>
[[pl:getFPSLimit]]
[[ru:getFPSLimit]]


==See Also==
==See Also==
{{Server functions}}
{{Server functions}}
[[Category:Needs_Example]]

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.

[[{{{image}}}|link=|]] Note:
  • Starting from version [r21313] and above fpsLimit range is 25-32767. In older MTA releases it was 25-100.

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