RefreshResources: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "{{Server function}} __NOTOC__ This function finds new resources and checks for changes to the current ones. ==Syntax== <syntaxhighlight lang="lua"> bool refreshResources ( ) </syntaxhighlight> ===Retur...")
 
No edit summary
Line 15: Line 15:
This example will refresh resources when a player uses the /refreshresources command just like the hardcoded /refresh.
This example will refresh resources when a player uses the /refreshresources command just like the hardcoded /refresh.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function commandRefreshResources()
function commandRefreshResources(player)
     refreshResources()
     refreshResources()
     outputChatBox("Resources refreshed", player, 255, 255, 0)
     outputChatBox("Resources refreshed", player, 255, 255, 0)

Revision as of 17:44, 16 March 2011

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

Syntax

bool refreshResources ( )

Returns

Returns true is refresh was successful, false otherwise.

Example

Click to collapse [-]
Server

This example will refresh resources when a player uses the /refreshresources command just like the hardcoded /refresh.

function commandRefreshResources(player)
    refreshResources()
    outputChatBox("Resources refreshed", player, 255, 255, 0)
end
addCommandHandler("refreshresources", commandRefreshResources)

See Also