Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by Hydra

  1. https://wiki.multitheftauto.com/wiki/OnClientExplosion this is the event
  2. You posted this in the wrong place
  3. You will need to use these: setElementModel() ---GUI--- onClientGUIClick ---DX---- onClientClick
  4. If you want your object to spin use moveObject() instead moveObject(theObject, timer, x, y, z, rotX, rotY, rotZ)
  5. Look at the default race resource and see how it was made
  6. You forgot to put the rotation arguments in the function: function rotateobj(obj, rx, ry, rz) setElementRotation(obj, rx, ry, rz) end Make sure you put the function in the meta.xml too <export function="rotateobj" type="shared" /> Type can be: client, server or shared local abc = exports.yourResource --// This is more easy than to put exports.resource:function local building = createObject(18002, 0, 0, 5) function rotatingObject() abc:rotateobj(building, 0, 0, 5) end addCommandHandler("rotatemyobj", rotatingObject)
  7. for money and skin you can use setAccountData, getAccountData, setElementData & getElementData. For faction better use database(db) https://wiki.multitheftauto.com/wiki/setAccountData https://wiki.multitheftauto.com/wiki/GetAccountData https://wiki.multitheftauto.com/wiki/SetElementData https://wiki.multitheftauto.com/wiki/GetElementData https://wiki.multitheftauto.com/wiki/Database
  8. using interpolateBetween Small example: local abc = false local alpha = 0 local tick = 0 function d() if abc then alpha = interpolateBetween(0, 0, 0, 255, 0, 0, (tick-getTickCount())/2500, "Linear") else alpha = interpolateBetween(255, 0, 0, 0, 0, 0, (tick-getTickCount())/2500, "Linear") end dxDrawRectangle(screenW * 0.2000, screenH * 0.3000, screenW * 0.0600, screenH * 0.0600, tocolor(255, 0, 0, alpha), false) end addEventHandler("onClientRender", root, d) function anim() if not animState then animState = true abc = true else animState = false abc = false end end bindKey("f2", "down", anim)
  9. setElementPosition(localPlayer, x-yourValue, y, z+0.5) ex
  10. You can use engineApplyShaderToWorldTexture and make client -> server -> client to be visible for others too
  11. set an element data for that group and use this: function a() if getElementData(localPlayer, "ClanName") then -- do something here else outputChatBox("You are not allowed to use this command", 255, 0, 0) end end addCommandHandler("abc1", a)
  12. Try reset your binds from MTA Settings
  13. You use the same variable for all of them, try using something like dff1, dff2, txd1, txd2 etc..
  14. Hydra

    Screen Size

    mostly at x and y
  15. Hydra

    Screen Size

    Yes it's possible to do that with rectangle too
  16. local myMarker = createMarker(0, 0, 5, "cylinder", 1.5, 255, 255, 255, 255, getRootElement()) function a(hitElement, matchingDimension) if hitElement == source then killPed(hitElement) else end end addEventHandler("onPlayerMarkerHit", myMarker, a) Is this what you want?
  17. Hydra

    Screen Size

    For text to be good positioned I use this: local screenW, screenH = guiGetScreenSize() resW = screenW/1600 --(put your resolution here instead of 1600) resH = screenH/900 --(put your resolution here instead of 900) function a() dxDrawText("asd", screenW * 0.2000, screenH * 0.3000, screenW * 0.0350, screenH * 0.0350, tocolor(255, 255, 255, 255), 1.00*resW, "bankgothic", "left", "top", false, false, false, false) end -- I put *resW on the text scale
  18. onClientVehicleDamage or onVehicleDamage
  19. Use the resource texture_names to see the blips texture name, create all blips on the map in different positions and that's it
  20. Use engineApplyShaderToWorldTexture
  21. The examples on the wiki are pretty clear on how you can use this function. Don't wait for someone to do your things for you and learn how you should do them. https://wiki.multitheftauto.com/wiki/GetCommandHandlers
  22. Hydra


    If you use createVehicle in client-side you can't drive the vehicles Note: Vehicles (and other elements) created client-side are only seen by the client that created them, aren't synced and players cannot enter them. They are essentially for display only.
  • Create New...