Jump to content

Mkl

Members
  • Posts

    44
  • Joined

  • Last visited

  • Days Won

    1

Mkl last won the day on July 21

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

Rat

Rat (9/54)

15

Reputation

  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)
  2. Mkl

    Help me

    Hi, I don't think getTime().hour is correct, check the wiki https://wiki.multitheftauto.com/wiki/GetTime
  3. 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)
  4. 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. ?
  5. 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.
  6. Hi, there is a function to turn on / off the engine https://wiki.multitheftauto.com/wiki/SetVehicleEngineState
  7. can't wait Merry christmas and happy new year everyone ?
  8. Usp, I meant the first (return) type mistake ?
  9. 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.
  10. Mkl

    [HELP]

    It coule be a shared type function, try with type="shared".
  11. Mkl

    Script

    Hi, Error comes from that addEvenHandler is not closed. Also, there is no attached function. addEventHandler("onClientClick", root, function(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedWorld) if (button == "right") and (state == "up") then --- script end end) -- end of function and ")" close addEventHandler Then, you have multiple other problems : there is functions with wrong name and other syntax problems that will not make your script works like : - getDistanceBetweenPoints3D() and his arguments wrongly writed, I guess it should be getDistanceBetweenPoints3D(x, y, z, pX, pY, pZ) (clicked position to player position). Plus, you could directly use worldX, worldY and worldZ rather than getting position of clickedWorld (clickElement in your script). https://wiki.multitheftauto.com/wiki/OnClientClick
  12. Hi, acces denied error means you have to give ACL rights to the resource : open ACL.xml, add <object name="resource.vehicle-manager"></object> in Admin ACL group (or use Admin resource to do it). Second error is about exported function of "mysql" resource not being recognized. Does this resource exist on your server ?
  13. predefined variable localPlayer doesn't exist serverside. You can direclty set the name as first argument, It'll send to root element by default, and so every players children. bool triggerClientEvent ( [ table/element sendTo = getRootElement(), ] string name, element sourceElement [, arguments... ] ) Set the sourceElement (3rd parameter), I suggest resourceRoot (the present resource). triggerClientEvent("eventName", resourceRoot) You can aim specific players by passing a table as first parameter (or loop). By the way be careful with your addEventHandler("onResourceStart", ...). Set getRootElement() (same as root predefined variable) will have for result to trigger the function everytime a resource is starting. You should rather use resourceRoot (for the actual resource). addEventHandler("onResourceStart", resourceRoot, createMinigunWeapon)
  14. Hi, we need to see more code context (the whole function, attached event or command and where you create peds) Would be great if you can use code blocks, thanks. For now all I can say is that ped1, ped2, ped3 variables are nil maybe due to your setTimer.
  15. It is updateState(value, total, radius), like updateState(50, 100, 250) should give half a circle. It could be edited to remove radius param in our case. This is the way I update the svg : local function setProgress(value) local svgXML = svgGetDocumentXML(mySvg) -- get xml local path = xmlNodeGetChildren(svgXML, 1) -- get path node (second node, following first example I gave) xmlNodeSetAttribute(path, "d", updateState(value, 100, 250)) -- editing the attribute svgSetDocumentXML(mySvg, svgXML) -- saving end You could imagine a command to test it like : local function startDemo() local value = 0 setTimer(function() value = value + 1 setProgress(value) end, 10, 100) end addCommandHandler("demo", startDemo) A little animation 0 to 100 % of the circle progress.
×
×
  • Create New...