Jump to content

Help me, doubts about 'race'


Recommended Posts

when I start the 'race' also automatically start '​​race_traffic_sensor' and 'race_toptimes'

race_traffic_sensor I not want to start when I start the race, and I changed the name race_toptimes to JK_toptimes obviously the race tries to find race_toptimes and can not find...

how do I change it?

Thanks! (and sorry for bad english ><')

Link to comment

@ Anderl, is not the "meta.xml"

remove the following lines from his "race_server.lua"

        --for _,line in ipairs(Addons.report) do 
            --outputConsole ( 'Race addon: ' .. line, source ) 
        --end 
  
--------------------------------------------------------------------- 
--[[ 
addEventHandler('onResourceStart', g_ResRoot, 
    function() 
        outputDebugString('Race resource starting') 
        startAddons() 
    end 
) 
]]-- 
----------------------------------------------------------------------- 
  
-- addon management 
Addons = {} 
Addons.report = {} 
Addons.reportShort = '' 
  
-- Start addon resources listed in the setting 'race.addons' 
function startAddons() 
    Addons.report = {} 
    Addons.reportShort = '' 
  
    -- Check permissions 
    local bCanStartResource = hasObjectPermissionTo ( getThisResource(), "function.startResource", false ) 
    local bCanStopResource = hasObjectPermissionTo ( getThisResource(), "function.stopResource", false ) 
    if not bCanStartResource or not bCanStopResource then 
        local line1 = 'WARNING: Race does not have permission to start/stop resources' 
        local line2 = 'WARNING: Addons may not function correctly' 
        outputDebugString( line1 ) 
        outputDebugString( line2 ) 
        table.insert(Addons.report,line1) 
        table.insert(Addons.report,line2) 
    end 
  
    for idx,name in ipairs(string.split(getString('race.addons'),',')) do 
        if name ~= '' then 
            local resource = getResourceFromName(name) 
            if not resource then 
                outputWarning( "Can't use addon '" .. name .. "', as it is not the name of a resource" ) 
            else 
                if getResourceInfo ( resource, 'addon' ) ~= 'race' then 
                    outputWarning( "Can't use addon " .. name .. ', as it does not have addon="race" in the info section' ) 
                else 
                    -- Start or restart resource 
                    if getResourceState(resource) == 'running' then 
                        stopResource(resource) 
                        TimerManager.createTimerFor("raceresource"):setTimer( function() startResource(resource) end, 200, 1 ) 
                    else 
                        startResource(resource) 
                    end 
                    -- Update Addons.report 
                    local tag = getResourceInfo ( resource, 'name' ) or getResourceName(resource) 
                    local build = getResourceInfo ( resource, 'build' ) or '' 
                    local version = getResourceInfo ( resource, 'version' ) or '' 
                    local author = getResourceInfo ( resource, 'author' ) or '' 
                    local description = getResourceInfo ( resource, 'description' ) or '' 
                    local line = tag .. ' - ' .. description .. ' - by ' .. author .. ' - version [' .. version .. '] [' .. build .. ']' 
                    table.insert(Addons.report,line) 
                    -- Update Addons.reportShort 
                    if  Addons.reportShort ~= '' then 
                        Addons.reportShort = Addons.reportShort .. ', ' 
                    end 
                    Addons.reportShort = Addons.reportShort .. tag 
                end 
            end 
        end 
    end 
end 
  
  
  

Link to comment

Ok , in my race_server I canceled the functions

--[[addEventHandler('onPlayerJoin', g_Root, 
    function() 
        outputConsole ( 'Race version ' .. getBuildString(), source, 255, 127, 0 ) 
        for _,line in ipairs(Addons.report) do 
            outputConsole ( 'Race addon: ' .. line, source ) 
        end 
    end 
)]]-- 

and

--[[addEventHandler('onResourceStart', g_ResRoot, 
    function() 
        outputDebugString('Race resource starting') 
        startAddons() 
    end 
)]]-- 

As said Anony... btw I found this in meta

"#addons" value="race_toptimes,race_traffic_sensor" 
                    accept="*" 
                    desc="List of race addon resources to load automatically" 
                    /> 

Should I change something?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...