From Multi Theft Auto: Wiki
Revision as of 16:35, 1 January 2015 by Strix (talk | contribs) (add oop syntax)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function retrieves the value of any attribute in a resource info tag.


string getResourceInfo ( resource theResource, string attribute ) 

OOP Syntax Help! I don't understand this!

Method: resource:getInfo(...)

Required Arguments

  • theResource: the resource we are getting the info from.
  • attribute: the name of the attribute we want info about.


Returns a string with the attribute value if it exists, false otherwise.


This function tells the server who's the author who made the currently running resource.

function outputAuthor()
    author = getResourceInfo ( getThisResource(), "author" )    --Get the authors name
    if author then    --if it exists
        outputChatBox( author .. " made this script." )    --tell the world his name
    else    --if it doesn't
        outputChatBox( "I've no idea who made this script." )    --apologize.

See Also