-
Posts
742 -
Joined
-
Days Won
16
Everything posted by Tails
-
Add this epic tool: Multi Selection Tool for the mta editor. https://community.multitheftauto.com/ind ... ls&id=5785
-
Not working
-
Same problem..Also forgot to mention, it starts bugging after a few maps and it still changes to non [ddas] maps.
-
Error on the last line: This starts after a few maps have been played.
-
Edited and tested it but won't work. Am getting bugs, game freezes after the 5 seconds countdown. Thanks for trying to help though!
-
This might be it: function startRandomMap() -- Handle forced nextmap setting if maybeApplyForcedNextMap() then return end -- Get a random map chosen from the 10% of least recently player maps, with enough spawn points for all the players (if required) local map = getRandomMapCompatibleWithGamemode( getThisResource(), 10, g_GameOptions.ghostmode and 0 or getTotalPlayerCount() ) if map then g_IgnoreSpawnCountProblems = map -- Uber hack 4000 if not exports.mapmanager:changeGamemodeMap ( map, nil, true ) then problemChangingMap() end else outputWarning( 'startRandomMap failed' ) end end
-
That's why I said it. I also found this code: 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 I'm not really a good scripter, but I was hoping if anyone could lead me in the right direction.
-
found this function problemChangingMap() outputRace( 'Changing to random map in 5 seconds' ) local currentMap = exports.mapmanager:getRunningGamemodeMap() TimerManager.createTimerFor("resource","mapproblem"):setTimer( function() -- Check that something else hasn't already changed the map if currentMap == exports.mapmanager:getRunningGamemodeMap() then startRandomMap() end end, math.random(4500,5500), 1 ) end I think it's linked to the mapmanager resource
-
We don't want them to vote for maps, they have to stay random.
-
Hi Mta fans and scripters, I was wondering if there's a way to exclude maps from the race gamemode because we'd like to only have maps that have the [DDAS] tag in our random map cycle but still be able to play other maps. Any bit of help is appreciated. Thanks, Tails Edit: I'm guessing something needs to be added to this bit of script from the race's base.lua: function RaceMode.endMap() if stateAllowsPostFinish() then gotoState('PostFinish') local text = g_GameOptions.randommaps and 'Next map starts in:' or 'Vote for next map starts in:' Countdown.create(5, RaceMode.startNextMapSelect, text, 255, 255, 255, 0.6, 2.5 ):start() triggerEvent('onPostFinish', g_Root) end end function RaceMode.startNextMapSelect() if stateAllowsNextMapSelect() then gotoState('NextMapSelect') Countdown.destroyAll() destroyAllMessages() if g_GameOptions.randommaps then startRandomMap() else startNextMapVote() end end end
-
Just like the title says. I have a map with lots the same objects but would like to change the texture of only one of the objects. I figured I'd use getElementByID but I can't get it to work because of my horrible scripting knowledge. addEventHandler('onClientResourceStart', resourceRoot, function() txd = engineLoadTXD ( "road.txd" ) engineImportTXD ( txd, 2091 ) --engineImportTXD ( txd, 2147 ) engineImportTXD ( txd, 2131 ) engineImportTXD ( txd, 2132 ) engineImportTXD ( txd, 2133 ) engineImportTXD ( txd, 2134 ) fridge = getElementByID("fridge3") and engineLoadTXD ( "road.txd" ) if fridge then engineImportTXD ( txd ) end end ) Any ideas? Thank you
-
Because I need them on a different timer. Exploded vehicles should spawn after ~30 seconds, vehicles that haven't should respawn after x minutes.
-
Exactly. Me and my team are running a freeroam map but we need a script that makes the vehicles respawn after they've been used or exploded. The two scripts above your posts work fine. It's just that the respawn timer for exploded vehicles won't work properly if I use both of the scripts at the same time. They'll respawn after a couple of seconds, 10 at most, while I've set the timer at 30 seconds.
-
No it works, but the vehicle doesn't respawn at say the parking lot where it was originally parked.
-
It doesn't respawn it to its original spawn location.
-
Hey there the script is working perfectly fine. However, the timer in the script below won't work properly alongside the above script. function respawnExplodedVehicle() setTimer(respawnVehicle, 20000, 1, source) -- The time it takes to respawn a vehicle (in ms) after it has exploded. end addEventHandler("onVehicleExplode", getRootElement(), respawnExplodedVehicle) Any ideas?
-
I'm not sure how to add that piece of code: function respawnAllVehicles() for _, vehicle in ipairs ( vehicles ) do vehicles = getElementsByType ( "vehicle" ) if ( vehicles ) then toggleVehicleRespawn ( vehicles, true ) -- enable vehicle respawn as it is necessary for the idle respawn to function setVehicleIdleRespawnDelay ( vehicles, 20000 ) -- tell the server to respawn the vehicle 20 seconds after it's been left. end end end addEventHandler("onResourceStart", root, respawnAllVehicles) [03:05:59] ERROR: [freeroam scripts]\markers\vehicles.lua:7: bad argument #1 to 'ipairs' (table expected, got nil)
-
Hey there, me again in need of your expertise... Trying to create a vehicle respawn script for freeroam but can't manage to get it to work: function respawnAllVehicles() vehicles = getElementsByType ( "vehicle" ) if ( vehicles ) then toggleVehicleRespawn ( vehicles, true ) -- enable vehicle respawn as it is necessary for the idle respawn to function setVehicleIdleRespawnDelay ( vehicles, 20000 ) -- tell the server to respawn the vehicle 20 seconds after it's been left. end end addEventHandler("onResourceStart", root, respawnAllVehicles) Debugging tells me it has bad arguments. Any ideas? Any help is greatly appreciated.
-
Would love to download this but it says Invalid Resource.
-
I managed to spawn the vehicles inside the stadium but the vehicles still remain invisible.
-
Did you add type="client" or type="server" in the meta file? Try either of those.
-
Just as title says. My friend is working on a map through the MTA map editor. It's locates inside the LV Stadium 2 interior. All vehicle spawns are placed but when testing the map it'll spawn you outside stadium in the MAIN interior. Is there any way we could fix this? Thanks in advance.
-
Anyone know where I can find the download to this mapping tool: https://wiki.multitheftauto.com/wiki/Mov ... cts_Editor Thanks in advance
-
https://wiki.multitheftauto.com/
