View Issue Details

IDProjectCategoryView StatusLast Update
0008098Multi Theft Auto : San AndreasServerpublic2014-03-20 18:37
ReporterarranTuna Assigned Tosbx320  
Status resolvedResolutionfixed 
Target Version1.4Fixed in Version1.4 
Summary0008098: Server debug script spam about getResourceRootElement

This line:

if (getResourceRootElement(res) == sourceResourceRoot) then

Causes this spam when I restart a script (or an element is destroyed):

[17:03:03] Stopping CITutil
[17:03:03] ERROR: [Utility]\CITops\destroyedElements.slua:16: getResour
ceRootElement: Resource CITStreetRacing is not currently running
[17:03:03] ERROR: [Utility]\CITops\destroyedElements.slua:16: getResour
ceRootElement: Resource CITStreetRacing is not currently running
[17:03:03] WARNING: CITutil requires upgrade as <min_mta_version> section in the
meta.xml is incorrect or missing (expected at least server 1.3.4-0.00000 becaus
e of 'util.luac')
[17:03:03] Use the 'upgrade' command to perform a basic upgrade of resources.
[17:03:03] Starting CITutil

Works fine in 1.3.5, spams like crazy on mtasa-1.4-unstable-6234-20140320-net41D6.exe

Looks like getResourceRootElement() behaviour has changed and complains when you try to get the resource root element of an not started resource or maybe it's getResources() that changed or maybe there is nothing wrong with the debug error and actually it's the script that needs to add a getResourceState check from now on?

Steps To Reproduce

This is a script I made to detect scripts which are deleting elements from other scripts when a script fails to dereference it's elements:

function checkForNaughtyScriptsThatDeleteRandomElements()
-- Ignore players
if (getElementType(source) == "player") then
return true

-- Get the resource that created the element
local sourceResourceRoot = getElementParent(getElementParent(source))
local theResource = false
for ind, res in pairs(getResources()) do
    if (getResourceRootElement(res) == sourceResourceRoot) then
        theResource = res

-- Output info if the destroying resource isn't the same as the creator resource
if (theResource and theResource ~= sourceResource and sourceResource) then
    local destroyerResource = tostring(getResourceName(theResource))
    local creatorResource = tostring(getResourceName(sourceResource))
    outputDebugString(destroyerResource..&quot; destroyed a &quot;..getElementType(source)..&quot; made by &quot;..creatorResource)

addEventHandler("onElementDestroy", root, checkForNaughtyScriptsThatDeleteRandomElements)

TagsNo tags attached.



2014-03-20 17:37

administrator   ~~0020428

Copy & Paste fail in r5434 when I argstreamed the server. getResourceDynamicRootElement has this error message and I just copied it over back then.

Fixed in

Issue History

Date Modified Username Field Change