getResourceName | Multi Theft Auto: Wiki Skip to content

getResourceName

Client-side
Server-side
Shared

Pair: renameResource

This page is incomplete! Help wanted!

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


This function gets the name of the specified resource.

Note

Every resource has a predefined global variable called resourceName whose value is the name of that resource.

Note

If you want to access the name of any resource-data you should use getElementID .

Syntax

getResourceName ( )

Code Examples

server

This simple example outputs a message in the console whenever a resource starts, stating the name of the resource.

addEventHandler("onResourceStart", getRootElement(),
function(res)
outputConsole("Resource " .. getResourceName(res) .. " just started.")
end
)