refreshResources | Multi Theft Auto: Wiki Skip to content

refreshResources

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function finds new resources and checks for changes to the current ones.

Note

The resource using this function needs access to function.refreshResources in order for this function to work. You can give it the access by including an aclrequest command in its meta.xml file or by adding it to the admin ACL group.

Syntax

bool refreshResources ( [ bool refreshAll = false, resource targetResource = nil ] )
Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use.

  • refreshAll (default: false): 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
  • targetResource (default: nil): MISSING_PARAM_DESC

Returns

  • bool: value

Returns true if refresh was successful, false otherwise.

Code Examples

shared

This 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)