Jump to content

IIYAMA

Moderators
  • Posts

    6,097
  • Joined

  • Last visited

  • Days Won

    218

Everything posted by IIYAMA

  1. @gubi What's with that visibleTo stuff? visibleTo is not the same as a parentNode, which can't be a table because it is not a node, neither a player which is not allowed to have children from resources. And even if it was allowed, it wouldn't change the visibility for players. This is where it matters: https://wiki.multitheftauto.com/wiki/Element_tree
  2. Not possible, unless you freeze the system by using a temporary infinity loop. Or use a custom resource as replacement.
  3. Line 7: use resourceRoot instead of root. Else the code will be executed for every starting resource. Minimal timer delay should be 50. (Atleast that was a problem I had in the past) Don't create timers within loops. Don't create timers within timers. (Dangerous)
  4. Every player in the server does have an account. If the account is not created by script, then it is a guest account, which is automatic deleted when it is not required any more. if not isGuestAccount ( acc ) then
  5. Ah oke Just don't add words that make it really aggressive: I meant, i've created my function for idle animations, not ready-to-use animations. And how can I reset players' idle time. So? WUTEVA, I DON'T NEED HELP WITH THIS ANYMORE! It will back fire and you get less help instead of more.
  6. Please behave yourself. We do not want to inherit your stress.
  7. See this function + example: https://wiki.multitheftauto.com/wiki/GetPlayerIdleTime
  8. @#~Scared In the editor there is a map setting called useLODs. (Also you can just edit the meta.xml of the map) <meta> <info type="map" version="1.0.0"></info> <map src="test-lods.map" dimension="0"></map> <settings> <setting name="#maxplayers" value="[ 128 ]"></setting> <setting name="#useLODs" value="[ true ]"></setting> <setting name="#gamespeed" value="[ 1 ]"></setting> <setting name="#minplayers" value="[ 0 ]"></setting> <setting name="#gravity" value="[ 0.0080000004 ]"></setting> <setting name="#waveheight" value="[ 0 ]"></setting> <setting name="#camera" value='[ [ [ &quot;0&quot;, &quot;0&quot;, &quot;0&quot; ], [ &quot;0&quot;, &quot;0&quot;, &quot;0&quot; ] ] ]'></setting> <setting name="#locked_time" value="[ true ]"></setting> <setting name="#weather" value="[ 0 ]"></setting> <setting name="#time" value="12:0"></setting> </settings> <script src="mapEditorScriptingExtension_s.Lua" type="server"></script> <script src="mapEditorScriptingExtension_c.Lua" type="client" validate="false"></script> </meta> This will enable a list of GTA san lowLOD elements. (but it doesn't include all, there for you have to script a little bit more to use default elements as lowLOD objects, edit the mapEditorScriptingExtension files for that. Keep performance in mind while making those tweaks.)
  9. Not create and attach the eventHandler to a new function. Use global named functions that can be attached and detached when it is no longer required. You currently created something you might consider similar to a memory leak.
  10. Hmm, now they work. Maybe related to an update of some sort, because I couldn't see them the moment I replied.
  11. That is already added. If that is not happening, then you will have to follow my instructions in my previous reply. Which should contain a copy of the new code with debug lines + results.
  12. I do recommend for your tests to only use Lua function. When using for example chat functions, MTA could/has have implemented a text buffer, if the queue is full it could either speed up or slow down the function speed (depending how it is programmed).
  13. @KaMi I can't see any images. ?
  14. Just for the people that didn't notice it. but ipairs as well as pairs are functions. Before you actually running the loop, you are executing (pre-process) functions. players = {1,2,3,4} theFunction, players2 = ipairs(players) -- note: players and players2 are the same table (not a copy) print(theFunction(players2, 0)) -- 1, 1 print(theFunction(players2, 1)) -- 2, 2 print(theFunction(players2, 2)) -- 3, 3 print(theFunction(players2, 3)) -- 4, 4
  15. Add some more debug lines to the code. 1. So that it is clear which code is running and which code doesn't. 2. Also inspect some of the variable so that we don't have to gamble what values are used. If you give me enough of that, then yes I will be able to help you better.
  16. local url = guiGetText(edit) triggerServerEvent("musics", resourceRoot, localPlayer, url ) addEvent("musics", true) addEventHandler("musics", resourceRoot, function(player, ...) if isElement(player) then triggerClientEvent("music", resourceRoot, player, ...) -- send to all players end end, false) addEvent("music", true) addEventHandler("music", resourceRoot, function(player, url) if isElement(player) then local x,y,z = getElementPosition(player) local sound = playSound3D(tostring(url), x, y, z, true) setSoundMaxDistance(sound, 100) exports.bone_attach:attachElementToBone(sound, player, 11, 0, 0, 0.4, 180) --[[ ... ]]
  17. That was already in the code from the beginning. You are asking the wrong person for that information.
  18. IIYAMA

    Help please!

    https://wiki.multitheftauto.com/wiki/EngineApplyShaderToWorldTexture See syntax for target element. Create a table serverside containing the shader target information and send that over when they join. Shouldn't be too hard after following a table tutorial.
  19. I can't detect any issues with the code after a quick look. Are you sure you tested it correctly?
  20. See this page for inspiration on how to setup the bindkeys: https://wiki.multitheftauto.com/wiki/OnVehicleWeaponFire The shots can be limited by disable the control: https://wiki.multitheftauto.com/wiki/Control_names vehicle_fire
  21. It should be available with in the element property window.
  22. First get the blip, then destroy the vehicle. Line 21, 22 Where is the blip creation part? Also, never trust values, so always add value checks.
  23. Move line 14 until 20. To line 6. The reason behind the error is that some of the functions aren't loaded yet before you use them.
  24. That is mostlikely the issue.
  25. You can freeze them, but that also means that you can't move them after loading the map.
×
×
  • Create New...