Jump to content

[HELP] Top Times panel doesn't work


ReckLess

Recommended Posts

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?

Link to comment

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.

Link to comment
  • 1 month later...

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?

Link to comment

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 
  

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