Jump to content

IIYAMA

Moderators
  • Posts

    6,089
  • Joined

  • Last visited

  • Days Won

    216

Everything posted by IIYAMA

  1. https://wiki.multitheftauto.com/wiki/DxDrawImage3D Scroll down and add the code, from under the headline: code
  2. Write one query to get the result, not 100000.
  3. Make all functions unique. MarkerHit5, renderDisplay, StopHandling, HandleTheRendering And attach this addEventHandler to the marker element(of the file) instead of the root element. addEventHandler("onClientMarkerHit", check2, MarkerHit5)
  4. When you are not on mobile. Show me all the content you have and show me the end result (with Photoshop/gimp), so that I can get a better idea of what you are trying to do. After that, I will give you instructions + the required information(incl. wiki links). You make your second iteration and I will give feedback with some code adjustments. Iterate, iterate, iterate etc. Easy
  5. Oke, show me what you got.
  6. It is always recommended to check if something has been created (or not) before executing more code. if NemesisRa then -- ... else iprint("NemesisRa has not been created") end This is not good, using the same variable for different data, which will overwrite itself. Unless there is a very good reason for... NemesisRa = exports [ "slothBot" ]:spawnBot ( -2551.4892578125, 640.34375, 27.8125, 90, 312, 0, 0, NemesisRa, 23,"chasing", true )
  7. There should be a warning on line 26. Because the hillArea hasn't been created yet. That happens after the resource has been started.
  8. Your goal is clear, but you do not describe your problem.
  9. A typo And the predefined variable source does not exist with addCommandHandlers. Use the first parameter instead. local Vehicle = createVehicle ( 470, 2485.3427734375, -1665.353515625, 13.34375 ) function weapon(player) if ( Vehicle ) then triggerClientEvent(root, 'createClientWeapon', player, Vehicle) end end addCommandHandler( "gocar", Vehicle, Weapon)
  10. Best scaling factor: (in my opinion) local screenWidth, screenHeight = guiGetScreenSize() local developmentScreenHeight = 1080 -- your resolution. local scaleFactor = screenHeight / developmentScreenHeight local imageSizeX, imageSizeY = 128 * scaleFactor, 128 * scaleFactor Do not scale over the X as because of the screen ratio. (except if it is for X position) With what are you filling it up? Because if it is just one colour then a rectangle is enough.
  11. https://wiki.multitheftauto.com/wiki/Client_Scripting_Events#Ped_events There are no ped damage events serverside.
  12. That depends on a lot of things. The only way to figure it out is by testing and testing with multiple players. I also do not know if the function setElementVisible works for the team element. If not, then you also have to re-loop and collecting all players. What you need to do is testing it with multiple players. There are just no other options function LlamaServicio(Player, Team) if Team == "Police" then local players = getElementsByType ( "player" ) local aclGroup = aclGetGroup ( "Police" ) for k, polices in pairs(players) do local blipvisible = false local account = getPlayerAccount(polices) if not isGuestAccount(account) then local accountName = getAccountName (account) if isObjectInACLGroup ( "user." .. accountName, aclGroup) then -- chat msg here (polices, "Backup requested, location on GPS") outputDebugString("Blip Attached! For player: " .. tostring(getPlayerName(polices)), 3) local myBlip = createBlipAttachedTo(polices, 20) setElementParent(myBlip, playerBlipRoot) setElementVisibleTo ( myBlip, root, false ) -- make it invisible for all players. (this does not have influence on new joined players.) setElementVisibleTo ( myBlip, polices, true ) -- I am not sure if it works for team players. You should test it with multiple players. blipvisible = true end end if not blipvisible then outputDebugString("I am not the police. For player: " .. tostring(getPlayerName(polices))) -- I am not the police end end -- chat msg here (player, "You called police.") end end
  13. There is also a for ... do in that code which is looping through the exact same element type. Not much of a difference.. Here you got a stripped version: (18+ only) local players = getElementsByType ( "player" ) local aclGroup = aclGetGroup ( "Police" ) for k, player in pairs(players) do local account = getPlayerAccount(player) if not isGuestAccount(account) then local accountName = getAccountName (account) if isObjectInACLGroup ( "user." .. accountName, aclGroup) then -- put your stuff. end end end
  14. But what does this script has to do with the glue script? Because the function setPedCanBeKnockedOffBike has no influence over the glue script.
  15. Not specific enough... Where does it go wrong? This code can't tell me right away what your problem is.
  16. Try the load the url after the browser white-list has been updated: https://wiki.multitheftauto.com/wiki/RequestBrowserDomains https://wiki.multitheftauto.com/wiki/OnClientBrowserWhitelistChange
  17. https://wiki.multitheftauto.com/wiki/AclGetGroup See example 2.
  18. exp_kill = get("ExpPorKill") -- no need for: nivel. Unless it is used by another resource. <setting name="*ExpPorKill" value="100" />
  19. Check if the setting is added to the meta.xml and filled in correctly. If that doesn't work, you can do something like this: (replace line 3) exp_kill = get("nivel.ExpPorKill") or 10 -- fill in a fallback value
  20. Remove removeEventHandler( "onClientRender", root, callfunction )
  21. local attachedElements = getAttachedElements(veh) if attachedElements[1] then fireWeapon ( attachedElements[1] ) end P.s. you are not attaching gun2 in your code. There is a typo.
  22. The element has to exist first before you can have interaction with it. Real world example: How can I help people on this forum, if they haven't been born yet? The answer to that is: I can not. So use: if isElement(aWarpForm) then Before you are going to have interaction with this element.
  23. You aren't executing the function `szinvaltas`. And I have also no clue why you put a function there. Also I do not understand where the variable `speed`/ speed value comes from.
  24. That is not the error/warning. But this: c.lua:5: attempt to concatenate local 'amount' (a nil value) Which makes the meaning of the issue very different. local screenW, screenH = guiGetScreenSize() local amount function asdasd() dxDrawRectangle(screenW * 0.8069, screenH * 0.5656, screenW * 0.1931, screenH * 0.0289, tocolor(0, 0, 0, 178), false) dxDrawText("Kaptál #01AC41"..amount.."Ft-ot.", screenW * 0.8063, screenH * 0.5656, screenW * 1.0000, screenH * 0.5944, tocolor(255, 255, 255, 255), 1.00, "sans", "center", "center", false, false, false, true, false) end addEvent("theclienteventname", true ) addEventHandler("theclienteventname", root, function ( amount_ ) amount = amount_ addEventHandler("onClientRender", root, asdasd) end)
×
×
  • Create New...