-
Posts
24 -
Joined
-
Last visited
iPot's Achievements
Civilian (7/54)
0
Reputation
-
It's a example built-in function. Like getPlayerName etc.. No didn't solve it. EDIT: Fixed.
-
Nope, doesn't change a thing. Like I expected. I used previous addCommandHandlers and functions (very basic ones) but with the same variables and it worked perfectly.
-
Thank you very much It works perfectly, where is the tutorial that explains the part I missed apparently? In theory this loop should work but it doesn't. How come? I defined variable2 and thePlayer btw. function testFunction() local variable = getVar(thePlayer) outputChatBox("Debug message",thePlayer) if (variable == 0 ) then if (variable2 == false) then outputChatBox("Debug message",thePlayer) takeAction() testFunction2() end end end function testFunction2() local variable = getVar(thePlayer) if (variable ~= 0) then outputChatBox("Debug message",thePlayer) takeAction2() testFunction() end function takeAction() -- Do things. testFunction() end function takeAction2() -- Do different things. testFunction() end addCommandHandler("command", testFunction) EDIT: I don't even get the first debug message in testFunction()
-
Should I use AddEvent/AddEventHandler here? Or are there other options. Like in GTA SA scripting you could just type JUMP @label. then I could use JUMP @otherFunction. It's not like that but that's why I came here, to ask. function testFunction testvariable = getTestData(aDude) if (testvariable == true) then -- go to otherFunction end end function otherFunction -- blablabla end bindKey(fire,both,testFunction) Already thanks. iPot PS: Nice tabbing for a newb huh?
-
Sorry for the offtopic but are you Puma from gtaforum.nl?
-
I was doubting if it existed (https://wiki.multitheftauto.com/wiki/Req ... and_Events). Secondly, that's exactly what I want seb. Like this would output a number from 0 - 12 test = getRadioChannel(thePlayer) outputChatBox(test) I will definitely do that So is there a way around this without changing the channel to 0?
-
Does this function even work? local radio = getRadioChannel(thePlayer) setRadioVolume(radio,0) iPot
-
It's been 2-3 years since I've been here and I'm picking MTA back up now. I'm wondering if there still doesn't exist a tool such as a MTA:SA --> MTA:DM map converter. Can't seem to find it in the list, only other conversion tools.
-
I got my dff, txd and col ready for use. Made a meta with a reference to them. But now I have to know how to spawn/create the objects ingame. Everyone who's going to help me, thank you I made this script, but nothing happens but no errors are given too.. function mapLoad ( name ) txd_weedisland = engineLoadTXD("weedisland.txd") engineImportTXD(txd_weedisland,3374) col_weedisland = engineLoadCOL("weedisland") dff_weedisland = engineLoadDFF("weedisland", 0 ) engineReplaceCOL(col_weedisland,3374) engineReplaceModel(dff_weedisland,3374) createObject ( 3374, 3092.17, -2054.60, 0.0, 0, 0, 0 ) end addEventHandler ( "onResourceStart", getRootElement(), mapLoad )
-
Hey all, I got this error bad argument in line 3. Can anyone help me? Just started today with LUA function GiveMoney( thePlayer, reward, receiver ) if ( receiver ) and ( receiver ~= thePlayer ) then givePlayerMoney ( receiver, 10000 ) else outputChatBox("Syntax error: /reward <receiver>", thePlayer, 255, 0, 34, false ) end end addCommandHandler( "reward", GiveMoney )
-
Well thank you I guess i deleted some wrong stuff Tom
-
Here are all my code's now : Meta for gamemode: <meta> <info author="Underworld" name="Bla" version="1" type="gamemode"/> <config src="help.xml" type="client" /> <script src="spawn.lua" /> </meta> Spawn script: function startMap(startedMap) local mapRoot = getResourceRootElement(startedMap) local players = getElementsByType("player") fadeCamera ( thePlayer, false, 1.0, 0, 0, 0 ) for key, player in pairs(players) do local spawn = spawns[math.random(1, #spawns)] local posX = getElementData(spawn, "posX") local posY = getElementData(spawn, "posY") local posZ = getElementData(spawn, "posZ") local angle = getElementData(spawn, "angle") spawnPlayer(player, posX, posY, posZ, angle) end end addEventHandler ( "onGamemodeMapStart", getRootElement(), startMap ) --------------------------------------------------------------------------------------------------------------- Meta for the map: <meta> <info author="Underworld" description="map" version="1" type="map" gamemodes="Bla"/> <map src="Bla.map"/> </meta> And here, the map: <map> <spawnpoint posX="2495.1257324219" posY="-1686.6124267578" posZ="13.513834953308" angle="3.4530944824219"/> <spawnpoint posX="2519.9204101563" posY="-1678.9359130859" posZ="14.879755020142" angle="91.500610351563"/> <spawnpoint posX="2509.6416015625" posY="-1654.0524902344" posZ="13.655654907227" angle="135.68103027344"/> <spawnpoint posX="2487.0036621094" posY="-1647.6352539063" posZ="14.0703125" angle="181.4281463623"/> <spawnpoint posX="2471.869140625" posY="-1686.2700195313" posZ="13.5078125" angle="325.85275268555"/> <spawnpoint posX="2469.6413574219" posY="-1650.4163818359" posZ="13.471806526184" angle="183.62147521973"/> <spawnpoint posX="2452.4020996094" posY="-1646.6909179688" posZ="13.468873977661" angle="178.92138671875"/> </map>
-
Now I feel like an idiot [20:52:03] ERROR: .../server/mods/deathmatch/resources/Headcrab/spawn.lua:7: empt to get length of global 'spawns' (a nil value)
-
There's another 1 [20:24:07] SCRIPT ERROR: ...Program Files/MTA DM/server/mods/deathmatch/resource s/Headcrab/spawn.lua:8: ']' expected near 'local' [20:24:07] INFO: Loading script failed: ...Program Files/MTA DM/server/mods/deat hmatch/resources/Headcrab/spawn.lua:8: ']' expected near 'local' I used the exact code as you said. Tom
-
I got this code here wich gives an error where I can't find the solution for. Anyone that can help is thankful. Here's the error btw: [19:26:43] SCRIPT ERROR: ...Program Files/MTA DM/server/mods/deathmatc s/Headcrab/spawn.lua:13: unexpected symbol near ')' [19:26:43] INFO: Loading script failed: ...Program Files/MTA DM/server hmatch/resources/Headcrab/spawn.lua:13: unexpected symbol near ')' And here's the code: function startMap(startedMap) local mapRoot = getResourceRootElement(startedMap) local players = getElementsByType("player") fadeCamera ( thePlayer, false, 1.0, 0, 0, 0 ) for key, player in pairs(players) do local spawn = spawns[math.random(1, #spawns)] local posX = getElementData(spawn, "posX") local posY = getElementData(spawn, "posY") local posZ = getElementData(spawn, "posZ") local angle = getElementData(spawn, "angle") spawnPlayer(player, posX, posY, posZ, angle)) end end addEventHandler("onGamemodeMapStart", getRootElement(), startMap Tom