SetFPSLimit: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 9: Line 9:


===Required Arguments===  
===Required Arguments===  
*'''fpsLimit:''' An integer value representing the maxmimum FPS. This value may be between '''25''' and '''100''' FPS.
*'''fpsLimit:''' An integer value representing the maximum FPS. This value may be between '''25''' and '''100''' FPS. You can also pass '''0''' or ''false'', in which case the FPS limit will be disabled.


===Returns===
===Returns===

Revision as of 17:27, 28 June 2009

This function sets the maximum FPS (Frames per second) that players on the server can run their game at.

Syntax

bool setFPSLimit ( int fpsLimit )         

Required Arguments

  • fpsLimit: An integer value representing the maximum FPS. This value may be between 25 and 100 FPS. You can also pass 0 or false, in which case the FPS limit will be disabled.

Returns

Returns false if it was not possible to set the limit, or if an invalud value was set. Returns true if the operation was successful.

Example

This command sets the fps limit in a command handler.

addCommandHandler ( "setfps", function ( player, command, limit )
  if ( hasObjectPermissionTo ( player, "function.setFPSLimit" ) ) then
    setFPSLimit ( limit )
  end
end )

See Also