Jump to content

Mkl

Members
  • Posts

    49
  • Joined

  • Last visited

  • Days Won

    2

Mkl last won the day on March 16

Mkl had the most liked content!

2 Followers

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

Snitch (10/54)

17

Reputation

  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
  2. 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.
  3. https://wiki.multitheftauto.com/wiki/Lua_compilation_API#Examples
  4. Hi, maybe with https://wiki.multitheftauto.com/wiki/AttachElements
  5. 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,
  6. 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)
  7. Mkl

    Help me

    Hi, I don't think getTime().hour is correct, check the wiki https://wiki.multitheftauto.com/wiki/GetTime
  8. 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)
  9. 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. ?
  10. 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.
  11. Hi, there is a function to turn on / off the engine https://wiki.multitheftauto.com/wiki/SetVehicleEngineState
  12. can't wait Merry christmas and happy new year everyone ?
  13. Usp, I meant the first (return) type mistake ?
  14. Hello I would say it depends on preference, I personnaly like the second way (using return). It makes not too many scopes and looks to me a good way to dissociate clearly validation of received arguments before executing the function. Some tips / observations about your code : 1 _ To check string length you can directly use # ( instead of string.len() ) for example : if (not #string > 0) then 2 _ Looks like a tool to give money. If you try to check money range, why don't you convert the string to a int/number ( using tonumber() ) and then doing necessary checks (if you need to check minimum / maximum range). 3 _ I don't understand string.len(AmountKey) ~= 16 which means if your string has not 16 char it return the error.
  15. Mkl

    [HELP]

    It coule be a shared type function, try with type="shared".
×
×
  • Create New...