-
Posts
51 -
Joined
-
Last visited
-
Days Won
3
Mkl last won the day on April 3
Mkl had the most liked content!
About Mkl
- Birthday 06/06/1994
Details
-
Gang
STF
-
Location
Ten Green Bottles
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Mkl's Achievements
Snitch (10/54)
18
Reputation
-
Hello, you are not connected to the database. Find in the code the dbConnect function and set your credentials. https://wiki.multitheftauto.com/wiki/DbConnect
-
Hi, onClientPlayerVehicleEnter first paramater is theVehicle element you entered addEventHandler("onClientPlayerVehicleEnter", localPlayer, function(theVehicle) You can get the model id of this vehicle using getElementModel(theVehicle) and check if the vehicule you entered is a valid model It is faster to use a table with key as id of the vehicle and set a boolean true as value because it allows you to check by calling the table with the id of vehicule you entered as key instead of checking with a loop. validModels = { [124] = true, [126] = true, -- etc } addEventHandler("onClientPlayerVehicleEnter", localPlayer, function(theVehicle) local id = getElementModel(theVehicle) if (validModels[id]) then -- your stuff end end) Cya,
- 1 reply
-
- 1
-
Hi, Would not the attached players follow the vehicle when switching dimension or interior if player is set as children of the vehicle. I'm not sure if it works, could be worth to try. Maybe attachElements is already setting element as children ... -- NOT TESTED function attachPlayerToVehicle(player, vehicle) if not getElementType(player) == "player" then return end if not getElementType(vehicle) == "vehicle" then return end attachElements(player, vehicle) setElementParent(player, vehicle) end edit : I tried with runcode, attached myself to a vehicle, set myself children to this vehicle, set a different interior and dimension to the vehicle and I was following it. I tried also wihout setting myself as children and I was not following. You whole code can only be a short function You could also override attachElements to handle any case by default. Have a nice day
-
hi, https://wiki.multitheftauto.com/wiki/OnClientVehicleDamage If this event is canceled, the vehicle health won't be reduced. Physical damage to the vehicle will remain.
-
https://wiki.multitheftauto.com/wiki/Lua_compilation_API#Examples
-
Hi, maybe with https://wiki.multitheftauto.com/wiki/AttachElements
-
HI, If I understand well you want to create a new column "team" and update it when a player change his team. The idea that come to my mind is to create a custom event "onPlayerChangeTeam" by overriding the setPlayerTeam function. addEvent("onPlayerChangeTeam", false) _setPlayerTeam = setPlayerTeam -- we save the original function -- override setPlayerTeam = function(thePlayer, theTeam) _setPlayerTeam(thePlayer, theTeam) triggerEvent("onPlayerChangeTeam", thePlayer, theTeam) -- a new event "onPlayerChangeTeam" end addEventHandler("onPlayerChangeTeam", root, function(theTeam) -- function to update the column setElementData(source,"status", "theTeam") end) Untested code But it depends on what you are trying to do. This idea is that, when the setPlayerTeam function is used in your code, the scoreboard is updated but I maybe missunderstand what you want Cya,
- 1 reply
-
- 1
-
Hi I noticed that : - The vehicle starts to be on fire below 250 / 1000 - When it's flipped it takes 1100 of damage during the explosion I don't see any event about detecting the vehicle on fire but you can still detect it like this : addEventHandler("onClientVehicleEnter", root, function() local vehicle = source setTimer(function() if getElementHealth(vehicle) < 250 then print("onFire") killTimer(sourceTimer) end end, 500, 0) end)
-
Hi, I don't think getTime().hour is correct, check the wiki https://wiki.multitheftauto.com/wiki/GetTime
-
Hi -- theElement: the element that entered the colshape. -- The source of this event is the colshape that was hit. function take(theElement, matchingDimension) if not (theElement == localPlayer) then -- Checks whether the entering element is the local player return end if not (isPedInVehicle(localPlayer) then -- Checks if local player is not in a vehicle return end -- your colshape stuff if getElementData(source, "take") == "+" then -- source = colshape local veh = getPedOccupiedVehicle(localPlayer) local model = getElementModel(veh) if model == 485 then triggerEvent("notiAdd", localPlayer, "success", "Done") else triggerEvent("notiAdd", localPlayer, "error", "Error") end end end addEventHandler("onClientColShapeHit", root, take)
- 1 reply
-
- 1
-
Happy birthday MTA ! I'm more than happy to share my little story. I think I've started playing MTA SA Race in 2007. I enjoyed a lot creating and playing Race maps and Destruction Derby maps. I played on several servers (like Betaflied DD if some of you remember). I remember the launch of MTA DM (where we played in loop Hay and Fallout ?). Then and because of MTA Race, I kept playing principally Race mode on several servers. During the last 4 years I tried out to develop my own scripts and it became a real hobby for me, the community forum and the discord server helped me a lot, I also started to enjoy helping others about script and modeling stuff. I hope this game and his community will stand again for many years. ?
- 81 replies
-
- awesomeness
- multi theft auto
- (and 6 more)
-
Hi, by using playSound inside onClientGUIClick event handler for this specific button. You'll have add your music to the resource and then find the part where this GUI window is scripted to add playSound function inside the existing event handler.
-
Hi, there is a function to turn on / off the engine https://wiki.multitheftauto.com/wiki/SetVehicleEngineState
-
can't wait Merry christmas and happy new year everyone ?
-
Usp, I meant the first (return) type mistake ?