Jump to content

Race Problem


xE//XenO

Recommended Posts

  • 3 weeks later...

In race_server.lua delete 

------------------------
-- Script integrity test

g_IntegrityFailCount = 0
TimerManager.createTimerFor("raceresource","integrity"):setTimer(
    function ()
        local fail = false
        -- Make sure all vehicles are valid - Invalid vehicles really mess up the race script
        for player,vehicle in pairs(g_Vehicles) do
            if not isElement(vehicle) then
                fail = true
                outputRace( "Race integrity test fail: Invalid vehicle for player " .. tostring(getPlayerName(player)) )
                kickPlayer( player, nil, "Connection terminated to protect the core" )
            end
        end

        -- Increment or reset fail counter
        g_IntegrityFailCount = fail and g_IntegrityFailCount + 1 or 0

        -- Two fails in a row triggers a script restart
        if g_IntegrityFailCount > 1 then
            outputRace( "Race script integrity compromised - Restarting" )
            exports.mapmanager:changeGamemode( getResourceFromName('race') )
        end    
    end,
    1000,0
)
 

In race_client.lua delete

------------------------
-- Script integrity test

setTimer(
    function ()
        if g_Vehicle and not isElement(g_Vehicle) then
            outputChatBox( "Race integrity test fail (client): Your vehicle has been destroyed. Please panic." )
        end
    end,
    1000,0
)
 

  • Like 2
Link to comment

This problem usually happens on old MTA maps that have been converted to the current format.

Some converts just skip the 'rotation' property of spawnpoints that had the rotation of 0...

IMO the best way to fix this i to find the line in race_server.lua

vehicle = createVehicle(spawnpoint.vehicle, x, y, z, 0, 0, spawnpoint.rotation, plate:sub(1, 8))

and add this just before that line:

if not spawnpoint.rotation then
  spawnpoint.rotation = 0
end

 

  • Like 1
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...