Jump to content

IIYAMA

Moderators
  • Posts

    6,097
  • Joined

  • Last visited

  • Days Won

    218

Everything posted by IIYAMA

  1. "onClientPlayerDamage" or "onClientExplosion" + getDistanceBetweenPoints3D + getElementPosition(localPlayer) setElementHealth(localPlayer, 0)
  2. hmm I was thinking about checking the memory(mipmap textures are bigger) or the load time(generating mipmaps cost more time). @CodyJ(L) But scaling down the images(in game) should work even better! Thx thx!
  3. How can I test that?
  4. In dxCreateTexture there is an argument called mipmaps. It will generate multiple copies in different resolutions, so that it looks good. If I create these mipmaps manually, do I have to enable or disable this option? (dds (image) files can have mipmaps included) element dxCreateTexture ( string pixels [, string textureFormat = "argb", bool mipmaps = true, string textureEdge = "wrap" ] ) element dxCreateTexture ( string pixels [, string textureFormat = "argb", bool mipmaps = true, string textureEdge = "wrap" ] )
  5. IIYAMA

    Lights

    https://wiki.multitheftauto.com/wiki/Resource:Dynamic_lighting
  6. Yea it would, just not automatic and not easy to maintain. samples = { {8*(screenY/1024)), dxCreateFont("addons/font.ttf",8*(screenY/1024))}, {10*(screenY/1024), dxCreateFont("addons/font.ttf",10*(screenY/1024))} -- ... } function getFontFromSize (size) local sampleIndex = 1 for i=1, #samples do if size > samples[i][1] then sampleIndex = i else return samples[sampleIndex][2] end end return samples[sampleIndex][2] end local font = getFontFromSize (10 *(screenY/1024)) function getFontVariantFromSize (font, size) local sampleIndex = 1 local samples = fonts[font] for i=1, #samples do if size > samples[i][1] then sampleIndex = i else return samples[sampleIndex][2] end end return samples[sampleIndex][2] end local font = getFontVariantFromSize (":race/addons/font.ttf", 10 *(screenY/1024)) Untested of course...
  7. IIYAMA

    [Help] Errors

    if x and y then -- code where you use x and y end Let me remind you that this section is for learning scripting and not for repairing scripts from the community. (if you are not a scripter)
  8. local fonts = {} local scalingPercentagePerSample = 0.05 -- 5% local samplesCount = 10 -- samplesCount validate -- if samplesCount / 2 ~= math.floor(samplesCount/2) then samplesCount = samplesCount+1 end --------------------------- function dxCreateSamplesForFont (filepath, size) local _, screenY = guiGetScreenSize() local samples = {} for sampleScaleMultiplier=1, samplesCount do sampleScaleMultiplier = sampleScaleMultiplier - samplesCount/2 local newSize = size * (screenY/1024) - (size * (screenY/1024) * (sampleScaleMultiplier * scalingPercentagePerSample)) iprint("newSize:", newSize) local font = dxCreateFont(filepath, newSize) samples[#samples+1] = {newSize, font} end return samples end fonts[":race/addons/font.ttf"] = dxCreateSamplesForFont (":race/addons/font.ttf", 10) And if you create samples?
  9. ?font = dxCreateFont(":race/addons/font.ttf",math.max(12*(x/1280), 8)) You can set an under limit. Custom fonts on low resolutions are indeed an problem. I also haven't solved that problem yet.
  10. You can do that by comparing the current position with the new position. If the current position is 90 and you are moving to 90, you should do nothing. If the current position is -90 and you are moving to -90, you should do nothing. If the current position is -45 and you are moving to -90, then you should execute the timer not 90 times, but only 45 times. end,100,90) Calculated to: end,100,45) This is just doing the math, like you do on school. I prefer onClientPreRender/onClientRender and getTickCount() for this kind of scripts, but I guess that is too complex for starters.
  11. if ry < 0 then ry = 360 + ry end Try this. It will make sure that the rotation is positive and yet you can give it negative values. (use it directly after you updated the variable ry) EDITED
  12. setTimer(function () ------------------- -- place it here -- ------------------- -------------------- -- and remove: +1 -- setVehicleComponentRotation(vehicle, "gearflapleft", rx, ry --[[ +1]], rz) -------------------- ----------------- -- debug it!!! -- iprint("Debugging the variable ry:", ry) ----------------- end,100,90)
  13. I am not sure about that at the moment, since you didn't even read it. A little shame on you. If you did read that topic, you would have known that waiting for warnings/errors will get you nowhere. (there is more to debugging) You can update the ry variable like this: (make sure you put it inside the function which is called by the timer) ry = ry + 1
  14. IIYAMA

    RGB Vector?

    Why do you want to vectorize RGB? Vectors are used for speed and direction and RGB isn't by default any of that.
  15. There is no tool that does what you want afaik. But there is a tool that can help you identify the texture names: shader_tex_names Which you can use in scripts like this: Shader { pass P0 { Texture[0] = gTexture; } } Script addEventHandler( "onClientResourceStart", resourceRoot, function () local textureReplacementsTable = { {"bullethitsmoke", "dds" , "dxt5"}, {"collisionsmoke", "dds" , "dxt5"}, {"bloodpool_64", "dds" , "dxt5"} } for i=1,#textureReplacementsTable do local textureData = textureReplacementsTable[i] local texShader = dxCreateShader ( "shaders/texreplace.fx" ) if texShader then dxSetShaderValue(texShader,"gTexture",dxCreateTexture("textures/" .. textureData[1] .. "." .. textureData[2], textureData[3])) engineApplyShaderToWorldTexture(texShader, textureData[1]) end end end)
  16. Might be also possible. But even if that is correct, not updating the ry variable will end up with the same result. ry = ry +1
  17. Update the variable: ry @Noah_Antilles follow this tutorial, because saying that something doesn't work, doesn't help fixing it at all.
  18. call(getResourceFromName("[DWN]Core"), "showErrorCode", player, "02) Try to use call instead. The exports function does not always work correctly, I haven't figured out the reason of that. Btw it is not recommended to use special characters in your resources names. [DWN]Core Those brackets are used to make folders invisible for the server. [invisible]
  19. and the meta of the resource you are calling? (since you have to enable export functions there)
  20. It doesn't say that. If you want to log that, you will need to create a script for that. local function announceUnban( theBan, responsibleElement ) if getElementType( responsibleElement ) then --Check if a player unbanned the IP/Serial outputServerLog( getPlayerName( responsibleElement ) .. " unbanned " .. ( getBanSerial(theBan) or getBanIP(theBan) ) ) --Output to the chatbox saying the player has unbanned the IP/Serial else outputServerLog("Resource unbanned: " .. ( getBanSerial(theBan) or getBanIP(theBan) ) ) --Output to the chatbox saying the player has unbanned the IP/Serial end end addEventHandler( "onUnban", root, announceUnban ) --Adds the event handler for 'onUnban' But there is way to check that without the script. It will not always be 100% accurate. You will have to scroll up to the places where the players have been banned. Open: server\mods\deathmatch\banlist.xml Check which ones have been removed. With that information you can pinpoint which admins might have removed that ban.
  21. IIYAMA

    Big file LUAC

    then you should be able to split the file, but indeed strange. Probably because the process took to long to execute and got killed.
  22. IIYAMA

    Big file LUAC

    what did you saved in it? You might want to consider splitting it up in multiple files even if it is a large table.
  23. server\mods\deathmatch\logs\server.log There you will find things like this: (ban) [2017-04-29 15:54:14] ADMIN: XXXX has banned XXXXX [2017-04-29 15:54:14] BAN: Serial ban was added by Anonymous admin And things like this: (unban) [2017-04-29 15:59:56] UNBAN: A ban was removed by XXXXXX
  24. Did you really ban yourself? You are fantastic! https://wiki.multitheftauto.com/wiki/RemoveBan
  25. Create the outlines of the ring in Photoshop, that solved the problem for me. See pm.
×
×
  • Create New...