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
  • {{OOP||[[resource]]:rename|name|getResourceName}} ...(but this isn't a valid resource) or if the name you specify isn't valid. It could also fail if the disk was full or for other similar reasons. Won't wo
    1 KB (181 words) - 13:37, 10 August 2021
  • local resourceName = getResourceName(startedResource) ...not matchingResource) then -- check if startedResource matches current, if it doesn't do not trigger custom event
    2 KB (190 words) - 22:43, 15 October 2023
  • ...MTA functions and events. It should only be used when debugging scripts as it may degrade script performance. local resname = sourceResource and getResourceName(sourceResource)
    5 KB (481 words) - 23:48, 7 August 2020
  • ...in the metafile as "raw", then it is passed through a pre-processor before it is returned to the client. This pre-processor works much like PHP or ASP bu This resource is called <* httpWrite( getResourceName(getThisResource()) ) *>
    9 KB (1,404 words) - 03:55, 20 August 2023
  • '''Note:''' It is required to register your ircbot to the module if you're willing to use bool ircRegister ( ircbot theBot, [ string resourceName = getResourceName ( getThisResource() ) ] )
    3 KB (377 words) - 16:45, 11 February 2015
  • In addition, it is possible to use this function to get information about a resource in the ...6 seconds. Therefore, the default setting of 10 connection attempts means it will be 60 seconds before your script gets a callback about the error. Redu
    7 KB (1,033 words) - 18:07, 26 December 2017
  • 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(theResource)
    2 KB (253 words) - 18:38, 17 December 2023
  • local resRoot = fsys.createTranslator( "mods/deathmatch/resources/" .. getResourceName(resource) .. "/" ); -- link this directory and set it into our dirs dictionary.
    2 KB (281 words) - 02:01, 24 January 2022
  • ...eck whether a file named 'myfile.txt' exists in the resource 'mapcreator', it can be done from another resource this way: ''fileExists(":mapcreator/myfil resourcename = getResourceName(resource) --every resource has a predefined global variable called resource
    3 KB (390 words) - 17:59, 20 December 2023
  • ...g only the name of the files (with their respective extensions). Otherwise it returns '''false'''. ...ourceFolder argument #1. The path must contain '/' at the end to make sure it is a directory.", 2)
    8 KB (976 words) - 19:29, 27 September 2023
  • local resRoot = fsys.createTranslator( "mods/deathmatch/resources/" .. getResourceName(resource) .. "/" ); -- link this directory and set it into our dirs dictionary.
    3 KB (415 words) - 20:06, 2 February 2014
  • ...'''?''' modifiers. The scan can be made recursive to enter every directory it finds, so that files and folders of a whole directory tree are captured. Th ...irectories and all matching file entries which were found during the scan. It returns '''false''' if '''dirPath''' is an invalid path specifier for the t
    3 KB (417 words) - 21:28, 14 November 2023
  • To use it, you need to make sure you need to have the following packages: ret = MTARPC.callFunction ( SERVER_HTTP_ADDRESS, "echobot", "getResourceName", arguments );
    3 KB (360 words) - 20:23, 23 September 2016
  • * Remember that 99% of the time it's a bug in your script, not an MTA bug! Don't report something to GitHub Is ...he long run as you'll spend less time being confused when you come back to it in a weeks time to debug a problem.
    8 KB (1,269 words) - 17:30, 2 August 2023
  • This resource is called <* httpWrite( getResourceName(getThisResource()) ) *> This resource is called <* = getResourceName(getThisResource()) *>
    9 KB (1,486 words) - 21:49, 21 February 2021
  • Returns a browser if it was successfully created, false otherwise. loadBrowserURL(webBrowser, "http://mta/"..getResourceName(resource).."/index.html" ) --Note: you need to specify the resource name in
    3 KB (508 words) - 15:30, 1 July 2021
  • This resource is called <* httpWrite( getResourceName(getThisResource()) ) *> This resource is called <* = getResourceName(getThisResource()) *>
    10 KB (1,423 words) - 20:47, 30 June 2022