RefreshResources
From Multi Theft Auto: Wiki
This function finds new resources and checks for changes to the current ones.
Syntax
bool refreshResources ( [ bool refreshAll = false ] )
Optional Arguments
NOTE: When using optional arguments, you must supply all arguments before the one you wish to use. For more information on optional arguments, see Optional Arguments.
- refreshAll: If true MTA will check for changes in all resources. If false, MTA will only check for new resources and try to reload resources with errors
Note: Checking for changes in all resources can result in lag for a short period of time. It should generally be avoided to set refreshAll to true.
Returns
Returns true is refresh was successful, false otherwise.
Example
Click to collapse [-]
ServerThis example will refresh resources when a player uses the /refreshresources command just like the hardcoded /refreshall.
function commandRefreshResources(player) refreshResources(true) outputChatBox("Resources refreshed", player, 255, 255, 0) end addCommandHandler("refreshresources", commandRefreshResources)
See Also
- fetchRemote
- copyResource
- createResource
- getResourceConfig
- getResourceDynamicElementRoot
- getResourceExportedFunctions
- getResourceFromName
- getResourceInfo
- getResourceLastStartTime
- getResourceLoadFailureReason
- getResourceLoadTime
- getResourceMapRootElement
- getResourceName
- getResourceRootElement
- getResources
- getResourceState
- getThisResource
- refreshResources
- removeResourceDefaultSetting
- removeResourceFile
- restartResource
- setResourceDefaultSetting
- startResource
- stopResource
- setResourceInfo