RemoveResourceDefaultSetting: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(New page: __NOTOC__ {{Server function}} This function is used to remove a default setting from specified resource. <!-- What are default settings? --> Category:Incomplete <!-- Do not remove...)
 
Line 18: Line 18:


==Example==
==Example==
<syntaxhighlight lang="lua">
This example would check if the server has the freeroam resource and removes the default settings called "spawnmaponstart".
--TODO
<syntaxhighlight lang="lua">addEventHandler("onResourceStart",resourceRoot,function()
local freeroamRes = getResourceFromName("Freeroam")
if(freeroamRes)then
removeResourceDefaultSetting(freeroamRes,"spawnmaponstart")
end
end)
</syntaxhighlight>
</syntaxhighlight>



Revision as of 03:05, 27 June 2012

This function is used to remove a default setting from specified resource.

Syntax

bool removeResourceDefaultSetting ( resource theResource, string settingName ) 

Required Arguments

  • theResource: the resource which setting is to be removed
  • settingName: name of the default setting which is to be removed

Returns

Returns true if the default setting was successfully removed, false otherwise.

Example

This example would check if the server has the freeroam resource and removes the default settings called "spawnmaponstart".

addEventHandler("onResourceStart",resourceRoot,function()
	local freeroamRes = getResourceFromName("Freeroam")
	if(freeroamRes)then
		removeResourceDefaultSetting(freeroamRes,"spawnmaponstart")
	end
end)

See Also