CreateCircuitActor(CupSelected, TrackSelected) local numCarsInRace = 1 if GameMode == E_MODE_TOURNAMENT then numCarsInRace = NumCars end -- Configuración del ESP (Control de estabilidad del coche) ESPConf = { angularThreshold = 0.2, breakingForce = 0.75, minimumSkid = 0.6, steerThreshold = 0.09, fase1 = true, fase2 = true } -- ESPConf = { angularThreshold = 0.2, breakingForce = 2, minimumSkid = 0.6, steerThreshold = 0.09, fase1 = true, fase2 = true } for ndx = 1, numCarsInRace, 1 do local playerId = GetPlayerIdByPos(ndx) if playerId == 0 then -- Usuario CreateCarActor("Car" .. ndx, ComposeSNSSUserName(12, "YOU"), CarScripts[CupSelected][SelectedCar], playerId, true) else -- CPU -- elige coche aleatorio de entre los desbloqueados local availableCars = {1} local carNdx = 1 for i=0,2,1 do if GetBestCupState(CupSelected, i) == E_CUP_GOLD then carNdx = carNdx+1 availableCars[carNdx] = i+2 end end local rand = math.random(#availableCars) CreateCarActor("Car" .. ndx, g_driverNames[CupSelected][UserLevel + 1][ndx], CarScripts[CupSelected][availableCars[rand]], playerId, false) end changeCarColor("Car" .. ndx, getColorByPlayerId(playerId)) if CupSelected == 3 then CreateAction("Car" .. ndx, "StabilizingCarAction", ESPConf) end end