Jump to content

IIYAMA

Moderators
  • Posts

    6,060
  • Joined

  • Last visited

  • Days Won

    208

Everything posted by IIYAMA

  1. you might want to put the code inside of the function and inside of the CODE BLOCK AT LINE 4. Your function ends at line 7.
  2. IIYAMA

    newResource

    addCommandHandler("refreshres",function(source) local resources = getResources() local oldResources = {} for i,v in ipairs(resources) do if getResourceState(v) ~= "failed to load" then oldResources[v] = true end end refreshResources(true) local resources = getResources() local newResources = {} for i,v in ipairs(resources) do if not oldResources[v] and getResourceState(v) ~= "failed to load" then newResources[#newResources + 1] = v end end iprint(newResources) outputChatBox("NewResource loaded: Here is the last resource name which loaded.", source, 255, 255,255,true) end) You might need to set a timer before you re-check the resources again. (not sure because I never tried it)
  3. IIYAMA

    setElementData

    setElementData(player,"Helmet", { {id="notSpecial", amount, armor}, {id="stupid", 999, -10000}, {id="IIYAMA", 1, 1000000000000000000} } ) setElementData(player,"Helmet", { notSpecial = { amount, armor}, stupid = {999, -10000}, IIYAMA = {1, 1000000000000000000} } )
  4. function generatePassword () local passwordLength = math.random(4) -- 1 t/m 4 local password = "" for i=1, passwordLength do password = password .. (math.random(10) - 1) -- 0 t/m 9 end return password end local passwordForGate = generatePassword() iprint(passwordForGate) addCommandHandler("hack", function (player, CMD, password) if password == passwordForGate then iprint("correct password") else iprint("wrong password") end end) This is just a sample. Not ready for a dynamic gate system. You should start with writing and preparing your gate script first. Because it has to be one thing. I can't help you any further, if you do not have your body/main/core code ready for integrating the password system.
  5. https://wiki.multitheftauto.com/wiki/OnClientPreRender dt is the timeslice. Read the wiki. It is the delay/time between the frames, created ONLY by the onClientPreRender If you have 60 fps. The timeslice is around: 1000(1sec) / 60 = 16,666666666666667 ms.
  6. @Professional You may want to reply. It is not @Professional...
  7. @tommymaster You may want to reply.
  8. Yea, thought you missed something in your explanation. You can try to check with getElementMatrix. But I can't help you getting rotations from rotation offsets of matrices, too much for me.
  9. True But fixing a warning/error = less lagg. It always helps in a way.
  10. I don't think so, because the timer is used to destroy elements, when the ped/player element is destroyed/(leaves the server). But you can test it if you want to be 100% sure. Just increase the timer duration to 50 ms and see if the delay still exist. (don't forget to change back, because 50 ms can lagg)
  11. What has position in your case to do with rotation? If you have 2 positions, then it would be something else. getElementRotation
  12. I don't know what that problem is. I don't think it is in here, more inside of the render core. Might be a gta bug or a bug in the script which hasn't been found out. The only way to find it, is to hard core debug it.
  13. Your query looks fine. I hope the solutions will help you with solving your problem.
  14. local clearing_nonexisting_peds = coroutine.create(forgetNonExistingPeds); setTimer(function() if coroutine.status (clearing_nonexisting_peds) == "dead" then clearing_nonexisting_peds = coroutine.create(forgetNonExistingPeds); end coroutine.resume(clearing_nonexisting_peds) end, 1000, 0); Replace line 112 and 113. It should recreate the coroutine when it is dead.
  15. I am not sure, I am not a fan of this custom function. Afaik dxDrawMaterialLine3D rotates between the points, but because the second point is moved, I am not sure which values you have to use. So I recommend you to use dxDrawMaterialLine3D instead.
  16. I help you over ~2 hours(no time), if you haven't got the awnser yet.
  17. Is there always 1 data per owner? Or can there be more data per owner?
  18. Show the query you are using. Solutions: You might want to use a callback, because the lua code will pause when you execute the query(if no call back). (which can cause a lot of lagg if the requested data size is very large) Save the data you collected inside of a table(as buffer). Use tickcount to decide if you re-call the mysql database or use the buffer. (which can improved your performance with 100 t/m 1000%) So if a guy is spamming/pushing the button a lot of time, your cpu usage will stay normal. Improve your query and set a: LIMIT 1000. Which will make sure that you do not overheat your database. You might not get all the results you need, but you can also request more later, see this example: https://stackoverflow.com/questions/5767479/mysql-limit-range
  19. Lol, this property is for clientside. No way serverside is going to download it's own files.
  20. https://wiki.multitheftauto.com/wiki/DxDrawImage3D Scroll down and add the code, from under the headline: code
  21. Write one query to get the result, not 100000.
  22. 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)
  23. 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
×
×
  • Create New...