
myonlake
Members-
Posts
2,312 -
Joined
-
Days Won
41
Everything posted by myonlake
-
This function has not been added in Multi Theft Auto yet, but I hope they'll add it as soon as possible
-
Hello, I am not a .txd modder, but are you able to publish this .txd file for us? I'd be pleased to get one copy as I might need it aswell.
-
As what D4N said, he wants the map, not the radar.
-
You're welcome
-
Man, you need to try yourself aswell... function beepClient(thePlayer) if isVehicleLocked(source) then if getElementData(source, "beeping") == false then local x, y, z = getElementPosition(source) local beep = playSound3D("sound/Alarm.mp3", x, y, z, true) attachElements(beep, source) setSoundVolume(beep, 2.0) setSoundMaxDistance(beep, 100) setElementData(source, "beeping", true) setTimer(function() detachElements(beep, source) stopSound(beep) setElementData(source, "beeping", false) end, 10000, 1) end end end addEventHandler("onClientVehicleStartEnter", getRootElement(), beepClient)
-
That script was a large mess. function beepClient(thePlayer) if isVehicleLocked(source) then local x, y, z = getElementPosition(thePlayer) local beep = playSound3D("sound/Alarm.mp3", x, y, z, true) setSoundVolume(beep, 2.0) setSoundMaxDistance(beep, 100) setTimer(function() stopSound(beep) end, 10000, 1) end end addEventHandler("onClientVehicleStartEnter", getRootElement(), beepClient) Timers were incorrect, of course it doesn't play it because you had playSound instead of playSound3D - you were also stopping the sound when starting. Do /debugscript 3 and show us the errors if any.
-
You think or you know? It's wrong, this function doesn't replace the radar images; I don't know the function for it, but your suggestion is not helping.
-
First of all, that getElementModel has no localed name, and you haven't stored the skin ID anywhere. Functions and such: Get and save the original local skin = getElementModel(player) setElementData(player, "originalskin", skin) Put the original local skin = getElementData(player, "originalskin") setElementModel(player, skin)
-
Stop doubleposting. Try now. local frozeTime = "60" -- Seconds as frozen local timeLeft = {} local timeLeftText = {} addEvent("Froze", true) addEventHandler("Froze", rootElement, function() if getPlayerMoney(source) >= 2000 then local players = getElementsByType("player") takePlayerMoney(source, 2000) outputChatBox("All players successfully frozen", source, 255, 255, 0, true) for theKey,thePlayer in ipairs(players) do setElementFrozen(thePlayer, true) setElementData(thePlayer, "Timeleft", frozeTime) showTimeLeft(thePlayer) end else outputChatBox("Not enough money.", source, 255, 0, 0, true) end end) function showTimeLeft(player) timeLeft[player] = textCreateDisplay() textDisplayAddObserver(timeLeft[player], player) timeLeftText[player] = textCreateTextItem("Time left: " .. getElementData(player, "Timeleft"), 0.45, 0.1, "high", 255, 255, 255, 255) textDisplayAddText(timeLeft[player], timeLeftText[player]) setTimer(updateTimeLeft, 1000, getElementData(player, "Timeleft"), player) end function updateTimeLeft(player) setElementData(player, "Timeleft", getElementData(player, "Timeleft") - 1) textItemSetText(timeLeftText[player], "Time left: " .. getElementData(player, "Timeleft")) if getElementData(player, "Timeleft") == 0 then textDestroyDisplay(timeLeft[player]) setElementFrozen(player, false) end end
-
Are you sure you meant addEventHandler (this can be only launched with a trigger). If you meant a command, then use addCommandHandler.
-
Oh my god! I love Multi Theft Auto, thanks!
-
Sorry! Forgot one thing, try now.
-
Hello, I am just wondering, that how can I make a pedestrian understand that there's an object in front of him, as if I want the pedestrian to walk another way.
-
Not tested, but try this. local frozeTime = "60" -- Seconds as frozen local timeLeft = {} local timeLeftText = {} addEvent("Froze", true) addEventHandler("Froze", rootElement, function() if getPlayerMoney(source) >= 2000 then local players = getElementsByType("player") takePlayerMoney(source, 2000) outputChatBox("All players successfully frozen", source, 255, 255, 0, true) for theKey,thePlayer in ipairs(players) do setElementFrozen(thePlayer, true) setElementData(thePlayer, "Timeleft", frozeTime) showTimeLeft(thePlayer) end else outputChatBox("Not enough money.", source, 255, 0, 0, true) end end) function showTimeLeft(player) timeLeft[player] = textCreateDisplay() textDisplayAddObserver(timeLeft[player], player) timeLeftText[player] = textCreateTextItem("Time left: " .. getElementData(player, "Timeleft"), 0.45, 0.1, "high", 255, 255, 255, 255) textDisplayAddText(timeLeft[player], timeLeftText[player]) setTimer(updateTimeLeft, 1000, getElementData(player, "Timeleft"), player) end function updateTimeLeft(player) setElementData(player, "Timeleft", getElementData(player, "Timeleft") - 1) textItemSetText(timeLeftText[player], "Time left: " .. getElementData(player, "Timeleft")) if getElementData(player, "Timeleft") == 0 then textDestroyDisplay(timeLeft[player]) end end
-
What's the problem you need help with? Only thing that I found was that you had few errors. addEvent("Froze", true) addEventHandler("Froze", rootElement, function() if getPlayerMoney(source) >= 2000 then local players = getElementsByType("player") takePlayerMoney(source, 2000) outputChatBox("All players successfully frozen", source, 255, 255, 0, true) for theKey,thePlayer in ipairs(players) do setElementFrozen(thePlayer, true) end else outputChatBox("Not enough money.", source, 255, 0, 0, true) end end)
-
Woudln't be so sure. If this could of not be opened in GTA:SA, then it'll not be possible to be opened in MTA neither. Looking forwards for the full map editor, to edit the original map
-
It happens when you go to your desktop while in-game. I am not sure, but you can try the windowed mode of Multi Theft Auto. As if you want a script to move the player out from the interior, you might want to use these (client-side): Function https://wiki.multitheftauto.com/wiki/SetElementPosition Event https://wiki.multitheftauto.com/wiki/OnClientMinimize
-
Next time use the forum's search feature, or browse this board. You have asked the same questions as someone else. viewtopic.php?f=91&t=37088
-
This is caused by the mirror effect. There's no fix for it at the moment, sorry, I know, it's an annoying problem and you might get timed out after a while.
-
Why even ask? I mean, it would be pretty stupid if it was allowed function.
-
Thanks snake once again That wouldn't help a cent.
-
Hello, When I type this shutdown command, it just shut it downs and then restarting it. function rotorsOn() local vehicle = getPedOccupiedVehicle(getLocalPlayer()) setHelicopterRotorSpeed(vehicle, 0.2) setVehicleEngineState(vehicle, true) end addCommandHandler("rotorson", rotorsOn) function rotorsOff() local vehicle = getPedOccupiedVehicle(getLocalPlayer()) setHelicopterRotorSpeed(vehicle, 0) setVehicleEngineState(vehicle, false) end addCommandHandler("rotorsoff", rotorsOff)
-
I'd try this, and it's not tested. local x, y, z = 1890.4000244141, -2612.5, 481.60000610352 local bgc = createMarker(2155.5, -2299.8999023438, 14.60000038147, "arrow", 1.5, 255, 255, 0) local bgcl = createMarker(x, y, z, "arrow", 1.5, 255, 255, 0) setElementInterior(bgcl, 11, x, y, z) function bgcenter(hitPlayer, matchingDimension) setTimer(function() setElementInterior(hitPlayer, 11, 1888.3000488281, -2623.1999511719, 481.89999389648) end, 2000, 1) fadeCamera(hitPlayer, false, 1) setTimer(function() fadeCamera(hitPlayer, true, 5) end, 3000, 1) end addEventHandler("onMarkerHit", bgc, bgcenter) function bgcleave(hitPlayer, matchingDimension) setTimer(function() setElementInterior(hitPlayer, 0, 2157.4194335938, -2299.0903320313, 13.478407859802) end, 2000, 1) fadeCamera(hitPlayer, false, 1) setTimer(function() fadeCamera(hitPlayer, true, 5) end, 3000, 1) end addEventHandler("onMarkerHit", bgcl, bgcleave)
-
Edited and the code should be working.
-
It was trying to find if(con) function, you had forgotten one space between them. Also I fixed the getRootElement() thing, because otherwise it would of done this script everytime when you start any resource. This new one will do it only if it's this specific resource. function GameModeInit() local con = mysql_connect("204.45.248.18", "", "", "") if (con) then outputChatBox("Connection Success!") else outputChatBox("Connection Failed!") end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), GameModeInit)