Jump to content

quindo

Members
  • Posts

    112
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by quindo

  1. Shader failed to create, "8007000e" means that it couldn't be created because there's not enough memory available. You could be creating too much of them, but there are also some problems with mta itself, which give that error even thought there is still theoretically lots of memory available.
  2. The server ip is 178.33.54.30:20256, it doesn't happen to all players. We are creating single shader and changing it's settings as needed in places that we can, but we need to use a lot of per entity shaders, all with different textures, at least 1 per player. The problem still is happening 1k+ times a day, we just apply a texture telling players to restart mta once shaders fail to create.
  3. Nope, we couldn't find what is causing it, neither did we get any reply from this thread.
  4. How are you attaching it to the gun? You shouldn't have to attach anything on onclientprerender, if you move camera on that event, try moving It to onCientRender
  5. Not really the same, pairs loop can iterate over unordered tables, so if you have something like local table = { ["item"] = val1, ["item2"] = val2, ["item3"] = val3 } Then you will be able to iterate over it only using pairs() for i,#table do can iterate only over tables like this: local table = { [1] = val1, [2] = val2, [3] = val3 }
  6. What do you mean by P3D? Only thing that comes to my mind is model format used by Crashday game.
  7. 1. There are issues with mta vram/ram management when it comes to graphical components like shaders or textures which may cause them to fail to create even when there's lots of memory still available theoretically. 2. Stuff like dxDrawImage don't stay in memory, they are queued to draw in current frame, and cease to exist afterwards. Textures used by them are stored in memory only. 3. No idea.
  8. There's also this pretty useful page: https://springrts.com/wiki/Lua_Performance Where you can see in test 9, that using for i-1, #table is more than 2 times faster than using ipairs. In reality you shouldn't bother with such micro optimizations if you aren't traversing tables with thousands of elements pretty often. The page can be pretty useful if you want to read more about lua optimization quirks tho.
  9. Where are you defining "vehicle"? Iin my script it's theVehicle.
  10. First thing first, onMarkerHit needs marker element instead of root element as second argument if you want to start the function only in certain marker, check it there: https://wiki.multitheftauto.com/wiki/OnMarkerHit And about the code, this should work, i haven't tested it, but you can see how it could be done: local marker1 = createMarker(2063.5, -1831.1999511719, 13, "cylinder",6,225,225,255,20) function repairVehicle ( thePlayer, matchingDimension) setTimer ( function() if thePlayer ~= localPlayer then return end local theVehicle = getPedOccupiedVehicle( thePlayer ) if not theVehicle then return outputChatBox( "You're not in a vehicle!", thePlayer, 200, 0, 0 ) end local vehHealth = getElementHealth( theVehicle ) if vehHealth >= 999 then return outputChatBox( "Your vehicle isn't damaged!", thePlayer, 200, 0, 0 ) end local money = getPlayerMoney( thePlayer ) if money >= 200 then local fixVeh = fixVehicle( theVehicle ) if fixVeh then takePlayerMoney( thePlayer, 200 ) return outputChatBox ("Your vehicle is restored.", thePlayer, 0, 200, 0 ) else return outputChatBox ( "Failed to fix your vehicle.", thePlayer) end end end, 5000, 1) end addEventHandler("onMarkerHit", marker1, repairVehicle)
  11. Looking at the wiki page of AttachElements you can see that only certain types of elements can be attached, the list doesn't include effects so it's safe to say that it can't be attached. There's this: https://wiki.multitheftauto.com/wiki/AttachEffect useful function, try it
  12. local gate1 = createObject(968, 1544.6999511719, -1623.9000244141, 13, 0, 89.1, 270) local marker1 = createMarker(1544.5, -1628, 13.5, "cylinder",6,225,225,255,25) local isMoving = false local moveTime = 2000 function moveToll(player) if isMoving then return end if source == marker1 then local move = moveObject(gate1, moveTime, 1544.6999511719, -1623.9000244141, 13, 0, -89.1, 0) if move then isMoving = true setTimer(gate2, 4000, 1, true) end end end addEventHandler("onClientMarkerHit", root, moveToll) function gate2() moveObject(gate1, moveTime, 1544.6999511719, -1623.9000244141, 13, 0, 89.1, 0) setTimer(function() isMoving = false end, moveTime, 1) end As for second problem, this should work, i haven't tested it, but you can see how this could be done. You have to save the current movement state in variable, and move the barrier only if it isn't already moving. You cant use moveObject as condition because it's function, it's gonna always return true. You can see that i save function result in variable "move" and check it in if afterwards. The variable "isMoving" is saving current state of movement. the statement "if isMoving then return end" makes it so the function doesn't start if the barrier is currently moving.
  13. Save timer start tick to some variable, and get remaining time using getTimerDetails, from that you can calculate progress.
  14. I'm gonna send you the logs from MTADiag through private message because some players don't want it to be shown publicly here.
  15. Hey, i wanted to try and use MTADiag on my own pc before sending it out to players and it returned "https://pastebin.mtasa.com/ <head><title>413 Request Entity Too Large</title></head> <body bgcolor="white"> <center><h1>413 Request Entity Too Large</h1></center> <hr><center>nginx</center> </body> </html>" I don't want to start asking players to run this while it's not certain that they will get the results, could you please check that out? I'm gonna wait with MTADiag until the reply, for now i have one more idea what may be causing that, but for that i need to explain a bit what we use those shaders for. Basically on our server we have cars paint jobs system, which plays a huge role in game play, we allow players to customize the cars paint by giving them ability to create their own paint jobs using layered images. The first time a vehicle is streamed, it's paint job must be generated into texture to use and cache it on player HDD, we do it by using rendertarget, drawing the entire paint job on this, and after that using dxGetTexturePixels and dxCreateTexture to save and use it. It may not seem at all related to shaders but lately we released standalone application that can act as rendertarget separate from mta, and we communicate with it using lua and files in our resources. (Released this because dxGetTexturePixels can take up to 1/4 second, which is pretty bad when it can happen at every vehicle stream in). It outputs ready dxt texture that we have just to load from file, we found out that players that use this application don't seem to be affected by the error in the post title at all. It's still only small percent of overall player base that uses this, but we started recommending this as a way to fight this error.
  16. First thing first: I'm not sure if I've chosen proper sub-forum for this, so if it isn't right place then please move it. I'm writing this because we have pretty game-breaking problem on our server that we can't find a way to fix on our side. The shaders randomly fail to create with warning specified in the title, it's happening more and more as our server gets bigger. We do track how often this error/warning happens for our players, and it's in thousands per day. It doesn't happen to all players, but when it happens we can't find any correlation to PC hardware. It happened on new high end pc's and on older hardware. The amount of memory used by MTA as shown in /showmemstat varies too, it's usually not even close to 3.5 gb limit, pretty often around 2gb. We did track, used/available VRAM by collecting data from dxGetStatus when the error happens, and usual there's lots of VRAM left too. Some example numbers here (free video memory for MTA / Total VRAM): 602/1024 2968/4084 It shows that there's enough RAM/VRAM available for MTA that it shouldn't be problem. The full error message also includes the path to shader and file/line. I looked over MTA sourcecode, and found that it fails at call to winapi, the returned HRESULT (8007000e) is E_OUTOFMEMORY which may happen if the memory couldn't be allocated, based on that we think it may be problem with MTA memory management. Some more thoughts: Once a single shader fails to create, all shaders fail to create after that (from what we observed) Our server is pretty big, the issue affects a lot of players but happens seemingly randomly. Some players aren't affected by this at all. I can't reproduce this on local server, neither by playing nor by forcing MTA to create a hundreds of thousands of shaders/textures and deleting them. We're also getting errors with HRESULT code 80070008, but it happens way less than the title error, it looks like that (happens with other shaders too): "[D3DXCreateEffectFromFile failed (80070008)[Loaded 'ngui-r\r.fx' (6737 bytes)]] @ 'dxCreateShader' [r.fx]" In last 16 hours this error happened more than 5300 times on our server, we limit the number of reported errors to 15 per player per session, based on that we can see it happened to a lot of players. Only way to fix this issue is to RESTART MTA, reconnect may help for few minutes but it fails quickly afterwards again. We would love any help with handling this issue, it's limiting our ability to work on server updates as our server relies heavily on shaders.
  17. function GetAccountNameFromSerial(player, serial) local accounts = getAccountsBySerial(serial) if accounts then for _,v in pairs(accounts) do outputChatBox(getAccountName(v)) end end end addCommandHandler("tes",GetAccountNameFromSerial)
  18. I can't understand what do you want exactly. You want to give function serial and get back account names? That's what my script does.
  19. function GetAccountNameFromSerial(serial) local accounts = getAccountsBySerial(serial) if accounts then for _,v in pairs(accounts) do outputChatBox(getAccountName(v)) end end end Something like that should work.
  20. Just to let you know, your download link shows up like that: That's probably why most people don't know where the download is, same thing happens to image in your signature.
  21. I don't think it is possible to address individual vertices from shaders in mta, at least i haven't found a way to do that.
  22. quindo

    Mouse cursor problem

    Same issue started happening for me today too, it doesn't matter if i join public server, or map editor. The cursor has delay even when i minimize mta, so it's affecting everything, the issues stop as soon as i quit MTA.
  23. maybe: if exports.StarMTA_core:Fejleszto(localPlayer) and level == 1 then if line then outputChatBox("#7CC576[StarMTA-Debugscript]: #FF3333ERROR:#FFFFFF"..message.." (#FFA500"..line.."#FFFFFF)",255,255,255,true) else outputChatBox("#7CC576[StarMTA-Debugscript]: #FF3333ERROR:#FFFFFF"..message,255,255,255,true) end end
  24. canwarp = 1 local antiwarping = { createColCuboid (200, 200, 20, 100, 100, 15) --The colshape } function warp(commandName, posX, posY, posZ) for i,colnumber in ipairs(antiwarping) do check = isElementWithinColShape(thePlayer, colnumber[i]) if check then canwarp = 0 break end end if canwarp == 1 then setElementPosition(localPlayer, posX, posY, posZ) else outputChatBox("can't warp here") end canwarp = 1 end addCommandHandler("setpos", warp) Try this, i didn't test it so it may not work, it's completely basic without any vehicle, etc checks. The command should be /setpos x y z
  25. marker = createMarker(1615.48865, -1506.98303, 12.20866,"cylinder", 2, 255, 0, 0, 255) () getRootElement what does the () getRootElement do here?
×
×
  • Create New...