Jump to content

[HELP] Top Times panel doesn't work


ReckLess

Recommended Posts

Posted

Hello!

I don't know why, but Top Times panel doesn't work on my own server. I finished all Skotinka maps, and other maps, but didn't appear the Top Time, I tried to finish the map in 3 players online because I thought the problem was because I was playing alone but it is not. Can someone help me?

Posted

That sucks.

DM toptimes are not in the default toptimes, you have to add it yourself. Lazy people come up with the easiest solution and someone I know came up with just a small edit in a script in the race resource, while someone else made a whole resource out of it, lol, like the one Deagle posted.

Open the race resource and open 'race_server.lua' using Notepad. Search (Ctrl+F) for this line (should be somewhere around line 670):

elseif pickup.type == 'vehiclechange' then 

Below this line:

clientCall(source, 'vehicleChanging', g_MapOptions.classicchangez, tonumber(pickup.vehicle)) 

Add this:

                if ( getElementModel(vehicle) == 425 or getElementModel(vehicle) == 464 or getElementModel(vehicle) == 520 or getElementModel(vehicle) == 447 ) and #getElementsByType("checkpoint") == 0 then 
                   triggerEvent('onPlayerFinish', source, rank, g_CurrentRaceMode:getTimePassed()) 
                    end 

Save it, restart the race resource and it should record the DM-toptimes.

All credits for this wonderful solution go to WannaKnow.

  • 1 month later...
Posted

Hey, I'm back :P

I need to fix this part of code:

if mapinfo.name and string.findIgnoreCase(mapinfo.name,"[DM]") then 

I wanna do something like that:

if mapinfo.name and (string.findIgnoreCase(mapinfo.name,"[DM]") or string.findIgnoreCase(mapinfo.name,"[OS]") then 

But it doesn't work, can you help me?

Posted

Does your [OS] map has hunter? If no, it will not work because of this:

  
     for _,e in pairs(getElementsByType("racepickup") or {}) do 
            local t = getElementData(e,"type") 
  
            if t and t == "vehiclechange" then 
                local v = getElementData(e,"vehicle") 
  
                if v and tonumber(v) == 425 then 
                    self.hasTimes = true 
                    break 
                end 
            end 
    end 
  
    if self.hasTimes then 
        self:doToggleToptimes( true ) 
    end 
  

To fix:

  
     for _,e in pairs(getElementsByType("racepickup") or {}) do 
            local t = getElementData(e,"type") 
  
            if t and t == "vehiclechange" then 
                local v = getElementData(e,"vehicle") 
  
                --if v and tonumber(v) == 425 then 
                    self.hasTimes = true 
                    break 
                --end 
            end 
    end 
  
    if self.hasTimes then 
        self:doToggleToptimes( true ) 
    end 
  

Posted

Obviously my OS (Old-School maps) have Hunter, I interpret Lua but I don't understand how to show TT's (and make them) with DM and OS. Can you just fix my code? (read my last post)

Posted

Okay, I've fixed it by myself:

if mapinfo.name and string.findIgnoreCase(mapinfo.name,"[DM]") or string.findIgnoreCase(mapinfo.name,"[OS]") then 
  

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...