Search results

Jump to navigation Jump to search
  • ...te|The file functions should not be used to implement configuration files. It is encouraged to use the XML functions for this instead.}} * '''overwrite''': If set to true it will overwrite a file that already exists at copyToFilePath.
    2 KB (300 words) - 17:35, 20 December 2023
  • string getResourceName ( resource res ) Returns a string with the resource name in it, or ''false'' if the resource does not exist.
    964 bytes (121 words) - 22:07, 10 February 2024
  • ...s your resource if any part of the code or some resource file has changed, it works just like "refreshResources ()" but adapted for one particular resour local meta = xmlLoadFile(":"..getResourceName(getThisResource()).."/meta.xml")
    2 KB (179 words) - 14:23, 23 January 2016
  • ...destroyed by [[destroyElement]] or when the creator resource is stopping. It is also triggered when a parent element of this element is destroyed. This example sends a message to the vehicle occupants when it's being destroyed.
    3 KB (408 words) - 02:56, 27 September 2018
  • local filePath = ":"..getResourceName(res).."/test.txt" if fileCopy(filePath, ":"..getResourceName(res).."/test1.txt") then
    3 KB (332 words) - 17:35, 20 December 2023
  • .... It returns empty string if the resource is on root ''resources'' folder. It returns '''false''' if the resource could not be found. This example outputs the path of the current resource when it is started.
    976 bytes (111 words) - 13:12, 10 August 2021
  • *'''oldState''': The state the [[resource]] was in before it changed. This code will output the state of resource when it's state will be changed:
    1 KB (125 words) - 21:24, 23 September 2021
  • ...esource failed to load, returns a string with the failure reason in it. If it loaded successfully, returns an empty string. Returns ''false'' if the reso if getResourceState(v)=="failed to load" then --check if it failed to load
    1 KB (146 words) - 13:39, 10 August 2021
  • ...he resource from which you wish to retrieve all command handlers. Or leave it empty to retrieve command handlers of all resources. ...( { "command", theResource } ). See examples below if you don't understand it.
    3 KB (290 words) - 09:53, 7 January 2019
  • This function deletes a resource from the MTA memory and moves it to the '''/resources-cache/trash/''' directory. --Check if it is an admin using this command
    2 KB (272 words) - 22:55, 26 September 2016
  • This example retrieves the current resource's root element and attaches it to an onResourceStart event handler. This causes the event handler to get c local resourceName = getResourceName(thisResource)
    1 KB (157 words) - 19:40, 14 March 2023
  • This function is used to unregister an {{ml_birc|ircbot}} for a resource. It is the opposite function for {{ml_birc|ircRegister}}. bool ircUnregister ( ircbot theBot, [ string resourceName = getResourceName ( getThisResource() ) ] )
    2 KB (187 words) - 16:45, 11 February 2015
  • '''Important:''' If you attach this event to the root element it will called when ''any'' resource starts, not just the resource your script outputChatBox ( "Resource " .. getResourceName(res) .. " loaded", root, 255, 255, 255 )
    1 KB (174 words) - 14:02, 2 June 2021
  • ...p://community.mtasa.com/mta/resources.php", handleVersionCheck, "version", getResourceName(getThisResource()) ) outputChatBox( getResourceName(getThisResource()) .. " is outdated. Your version: " .. thisVer .. " | Curr
    4 KB (489 words) - 09:25, 23 June 2016
  • Returns a [[float]] size of the resource counting the meta. Otherwise it returns ''false''. local resourceName = getResourceName(res)
    4 KB (436 words) - 18:27, 14 November 2021
  • * None specified: ''private'' if it is a local setting, ''public'' if it's a global setting. The ''resourceName'' is optional. If it isn't specified, then the setting is ''global''.
    2 KB (308 words) - 19:04, 1 March 2023
  • ...used in HTML pages hosted on the MTA server as part of a resource. To use it, place the following in the ''<head>'' section of your page. <* = call(getResourceFromName("ajax"),"start", getResourceName(getThisResource()) ) *>
    2 KB (265 words) - 20:25, 23 September 2016
  • '''When using the fileSystem module, it is highly suggested to restrict access to this function to priviledged reso -- Then we create a raw OS filesystem link to it.
    2 KB (249 words) - 02:42, 19 January 2022
  • '''When using the fileSystem module, it is highly suggested to restrict access to this function to priviledged reso -- Then we create a raw OS filesystem link to it.
    2 KB (250 words) - 21:50, 16 January 2022
  • * Another resource stopped it using [[stopResource]]. outputChatBox( "The resource " .. getResourceName( resource ) .. " was stopped!", root )
    2 KB (206 words) - 22:06, 9 October 2019
View (previous 20 | ) (20 | 50 | 100 | 250 | 500)