GetFPSLimit: Difference between revisions
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...) |
(Example added) |
||
Line 12: | Line 12: | ||
==Example== | ==Example== | ||
This | This example displays a message in the chatbox showing the current fps limit. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | function fpsLim() | ||
outputChatBox ( "The FPS limit is: " .. tostring( getFPSLimit () ) ) --function returns an int so we must convert it to a string | |||
end | |||
-- Add console command "fpslimit" which calls the function fpsLim | |||
addCommandHandler ( "fpslimit", fpsLim ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 12:47, 15 October 2008
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 100 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 fpsLim() outputChatBox ( "The FPS limit is: " .. tostring( getFPSLimit () ) ) --function returns an int so we must convert it to a string end -- Add console command "fpslimit" which calls the function fpsLim addCommandHandler ( "fpslimit", fpsLim )