Jump to content

Selavi

Members
  • Posts

    4
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Selavi's Achievements

Vic

Vic (3/54)

0

Reputation

  1. Hi, I tried do script about ( ADD SPOILER AFTER START MAP WITH TIMER 5 SEC): Load map -- 5 sec -- add spoiler. ( ID Spoiler 1158) https://wiki.multitheftauto.com/wiki/AddVehicleUpgrade I can't do it, please help me.
  2. Witam, przerobiłem lekko gamemode "race" i po zakończeniu mapy odlicza 5 sec po czym ładuje losowo następną: Chciałbym zamienić, to losowe na tą samą mapę. (przykład: RaceCheetah->RaceCheetah). Jeżeli dobrze myślę to funkcję należy zmienić tu (mapmanager_main.lua): addEventHandler("onResourceStart", rootElement, function (startedResource) --Is this resource a gamemode? if isGamemode(startedResource) then --Check no gamemode is running already if getRunningGamemode() then return end if triggerEvent("onGamemodeStart", getResourceRootElement(startedResource), startedResource) then currentGamemode = startedResource --Setup our announcements local gamemodeName = getResourceInfo(currentGamemode, "name") or getResourceName(currentGamemode) if get("ASE") then setGameType(gamemodeName) end if get("messages") then local name = getInstigatorName ( " by " ) or "" outputMapManager("Gamemode '"..gamemodeName.."' started" .. name .. "." ) end --We need to wait a while to see if any maps were started. If not, lets try and start a random one setTimer( function() if not getRunningGamemodeMap() then --Lets check if there are any maps for this gamemode local maps = getMapsCompatibleWithGamemode(getRunningGamemode()) --If we have any, we'll start a random one if #maps > 0 then changeGamemodeMap (maps[math.random(1,#maps)]) end end end, 50, 1 ) else currentGamemode = nil end elseif isMap(startedResource) then --If its a map --Make sure there is a gamemode running if not getRunningGamemode() then return end --Is there a map running already? if getRunningGamemodeMap() then return end --Is it compatible with our gamemode? if isGamemodeCompatibleWithMap ( getRunningGamemode(), startedResource ) then --Lets link the map with the gamemode if ( triggerEvent("onGamemodeMapStart", getResourceRootElement(startedResource), startedResource) ) then currentGamemodeMap = startedResource --Setup our announcements local gamemodeMapName = getResourceInfo(currentGamemodeMap, "name") or getResourceName(currentGamemodeMap) applyMapSettings( currentGamemodeMap ) if get("ASE") then setMapName(gamemodeMapName) end if get("messages") then local name = getInstigatorName ( " by " ) or "" outputMapManager("Map '"..gamemodeMapName.."' started" .. name .. ".") end else currentGamemodeMap = nil end end end end ) addEventHandler("onResourceStop", rootElement, function (stoppedResource) -- Incase the resource being stopped has been deleted local stillExists = false for i, res in ipairs(getResources()) do if res == stoppedResource then stillExists = true break end end if not stillExists then return end local resourceRoot = getResourceRootElement(stoppedResource) if stoppedResource == currentGamemode then triggerEvent("onGamemodeStop", resourceRoot, currentGamemode) currentGamemode = nil setGameType(false) if currentGamemodeMap then stopResource(currentGamemodeMap) elseif nextGamemode then startGamemodeT(nextGamemode) nextGamemode = nil if nextGamemodeMap then startGamemodeMapT(nextGamemodeMap) nextGamemodeMap = nil end end elseif stoppedResource == currentGamemodeMap then triggerEvent("onGamemodeMapStop", resourceRoot, currentGamemodeMap) currentGamemodeMap = nil resetMapInfo() setMapName("None") if nextGamemode then startGamemodeT(nextGamemode) nextGamemode = nil if nextGamemodeMap then startGamemodeMapT(nextGamemodeMap) nextGamemodeMap = nil end elseif nextGamemodeMap then startGamemodeMapT(nextGamemodeMap) nextGamemodeMap = nil end end end ) Nie jestem utalentowany w większej partii kodu więc prosiłbym o przeróbkę. Z góry dziękuję
  3. Witam, wprowadziłem funkcję do 'wheels moda' który po wciśnięciu F1 wyłącza się lub włącza. Chciałbym wprowadzić ograniczenie do tej funkcji ( 5 sec ). Aby wyłączyć/włączyć można było dopiero po 5 sekundach. state = true function rWheels() state = not state if state then for _,v in pairs(wheels) do engineRestoreModel(v[2]) end outputChatBox('You chose original car wheels') else replace() outputChatBox('You chose modified car wheels') end end bindKey ( "F1", "down", rWheels )
×
×
  • Create New...