Jump to content

Shuubaru

Members
  • Posts

    41
  • Joined

  • Last visited

Everything posted by Shuubaru

  1. much love to Alex for his wheel scale functions, seriously you made life happier for modders and of course, huge thanks to mta team and contributors!!
  2. Not sure if it is possible but it'd be wonderful if we can to select specific objects in screen by making a border selection like in blender:
  3. Thanks for the answer, it'll be nice to have that feature. I'm currently using it and works really good! Thanks for sharing it!
  4. Awesome! I built my server using your very very first version of the mgm, it got a lot of bugs but was also a nice start to me since thanks to it a learned a lot of scripting and new scripting techniques. It's nice to see you are releasing now a really improved version.
  5. Just a quick question, what about ACL users that have no access to resources and such, those options are also limited on the software when loggin?
  6. Creo que ahi dice bien claro cual era mi problema con los zips: el modulo para extraerlos generaba un loop gigantesco el cual MTA aborta. Con la ayuda de un par de tutoriales de coroutines logre hacerlo. Mi intencion era hacer un sistema de subida de archivos de la mano con dropbox, la verdad dudo que alguien alguna vez implemente esto por 3 razones algo triviales, la primera es el uso de CPU para extraer archivos de mas de 2mb, la segunda que para los jugadores esto podria ser algo tedioso (sobretodo para el jugador promedio de MTA que se le rompe el mundo cuando un server pesa mas de 20mb), y la tercera que la mayoria usan subidas desde las web de los servidores y se ahorran todo este trabajo. Esto en todo caso no fue mas que un experimento para ver si es que era posible hacer todo este sistema, y vaya que lo fue.
  7. ya logre solucionarlo, porfa cierren el tema! por alguna razon ya no puedo editarlo
  8. Hola buenas, a falta de la necesidad de un descompresor de archivos zip en mta (lo cual me sorprende que en pleno 2018 aun no tenga uno), me vi en la obligacion de usar una libreria existente. Necesito saber como reescribir parte de la funcion getb() puesto que el loop que genera en archivos superiores a 2mb puede llegar a ser realmente gigantesco y MTA por consiguiente termina abortandolo. He visto que hay formas de hacerlo con coroutines (pausandolas y resumiendolas), pero no logro entender como adaptar parte de las funciones que estan dentro de la funcion principal, puesto que estan en OOP, lo cual para mi sigue siendo medio chino. Ojalas me puedan echar una mano con esto, mas alla de que parte del codigo ya haya estado hecho, la verdad es que me tomo bastante tiempo adaptarlo a las funciones de MTA y escribir todo el resto, horas y horas de testeo. Se tambien que con debug.setHook(nil) se pueden forzar loops largos pero el lag que generaria realmente no lo compensa. -- file = string obtenido desde fileRead local function bitstream_init(file) local bs = { file = file, buf = nil, len = nil, pos = 1, b = 0, n = 0, } function bs:flushb(n) self.n = self.n - n self.b = bitRShift(self.b,n) end function bs:getb(n) while self.n < n do if self.pos > self.len then self.buf = self.file:read(4096) self.len = self.buf:len() self.pos = 1 end self.b = self.b + bitLShift(self.buf:byte(self.pos),self.n) self.pos = self.pos + 1 self.n = self.n + 8 end local ret = bitAnd(self.b,bitLShift(1,n)-1) self.n = self.n - n self.b = bitRShift(self.b,n) return ret end function bs:getv(hufftable,n) while self.n < n do if self.pos > self.len then self.buf = self.file:read(4096) self.len = self.buf:len() self.pos = 1 end self.b = self.b + bitLShift(self.buf:byte(self.pos),self.n) self.pos = self.pos + 1 self.n = self.n + 8 end local h = reverse[bitAnd(self.b,255)] local l = reverse[bitAnd(bitRShift(self.b,8),255)] local v = bitAnd(bitRShift(bitLShift(h,8)+l,16-n),bitLShift(1,n)-1) local e = hufftable[v] local len = bitAnd(e,15) local ret = bitRShift(e,4) self.n = self.n - len self.b = bitRShift(self.b,len) return ret end function bs:close() if self.file then self.file:close() end end if type(file) == "string" then bs.file = nil bs.buf = file end bs.len = bs.buf:len() return bs end Gracias de antemano!
  9. Usa el map editor de GTA, ubica el objeto y ya tendras la ID para eliminarlo.
  10. Well, it's seems the problem was that executeBrowserJavascript function was called first, before that the page itself were loaded... I've used a timer to call that function in 2 seconds and now it does work in the way I want: setTimer(executeBrowserJavascript,2000,1,theBrowser, "document.getElementById('UsernameInput').value = '"..username.."';") setTimer(executeBrowserJavascript,2000,1,theBrowser, "document.getElementById('PasswordInput').value = '"..password.."';")
  11. Hello, I'm having some problems with this functions as I'm not familiar with javascript, I'm working with a HTML login which is almost done except for one thing, the user data saving. I've seen some "examples" about the use of javascript in login panels and follow the examples didn't work in any way. I just want to load the username and password from some xml and then autofilling them on the login panel, like this: This is what I tried: HTML <form action="javascript:loginTrigger()" method="post"> <input id="UsernameInput" type="text" class="username" placeholder="Username"> <input id="PasswordInput" type="password" class="password" placeholder="Password"> <button type="submit" class="log_button">Login</button> <div class="error"><span style="color:#999">+</span></div> </form> LUA username = magicalFunctionThatLoadTheUsername() password = magicalFunctionThatLoadThePassword() executeBrowserJavascript(theBrowser, 'document.getElementById("UsernameInput").val = "'..username..'";') executeBrowserJavascript(theBrowser, 'document.getElementById("PasswordInput").val = "'..password..'";') I'm not experienced with javascript (as you can obviously see) but I don't really get why it does not work as I'm follow the same steps as other examples I've seen around the web.
  12. Official stuff will never return sound.
  13. Does anybody knows about a good youtube api? Please refrain to say "youtubeinmp3" (returned links from fetchRemote don't work) or "youtubemp3script" (you need an api key, and they never answer the emails asking for an api key).
  14. I was dreaming with custom large maps with no bugs. DayZ servers will love this.
  15. I think you misundertood. Or I explain it bad because my english is not enough good. What I wanted to do is order the nicks by them kills, I mean, if someone have the first place and 20 kills his nick will be first. Btw, I manage to do it just using another way (tables inside a table): function testCols () RankingData = {} tablaCol = getElementsByType("colshape") for i=1,#getElementsByType("colshape") do colEle = getElementData(tablaCol[i], "kills.actual") colNom = getElementData(tablaCol[i], "kills.names") table.insert(RankingData,{name=colNom,data=colEle}) end setTimer(function() table.sort(RankingData,function(a,b) return(tonumber(a.data) or 0 ) > ( tonumber(b.data) or 0 ) end ) refreshTopKills(RankingData) --after this I will retrieve all the datas by kills order end, 50, 1) setTimer(function() addEventHandler("onClientRender", getRootElement(), renderTabla) end, 100, 1) end bindKey("5", "down", testCols) function refreshTopKills( info ) showRanking = {} for i=1,#info do table.insert(showRanking, info[i]) end end I hope it will be useful for someone else.
  16. Hi, I need to find a way of sorting two tables with the same order: "kills" and "player names" tables, I manage to sort kills table by value but I don't know how to sort the player names table with the same order than kills table. Here is my code: --client side local screenW, screenH = guiGetScreenSize() --I use the colshapes to "simulate" players datas. col1 = createColSphere(0,0,0, 1) col2 = createColSphere(0,0,0, 1) col3 = createColSphere(0,0,0, 1) col4 = createColSphere(0,0,0, 1) col5 = createColSphere(0,0,0, 1) col6 = createColSphere(0,0,0, 1) col7 = createColSphere(0,0,0, 1) col8 = createColSphere(0,0,0, 1) col9 = createColSphere(0,0,0, 1) col10 = createColSphere(0,0,0, 1) col11 = createColSphere(0,0,0, 1) setElementData(col1, "kills.actual", 5) setElementData(col2, "kills.actual", 10) setElementData(col3, "kills.actual", 16) setElementData(col4, "kills.actual", 2) setElementData(col5, "kills.actual", 1) setElementData(col6, "kills.actual", 50) setElementData(col7, "kills.actual", 21) setElementData(col8, "kills.actual", 21) setElementData(col9, "kills.actual", 12) setElementData(col10, "kills.actual", 9) setElementData(col11, "kills.actual", 106) setElementData(col1, "kills.names", "test1") setElementData(col2, "kills.names", "test2") setElementData(col3, "kills.names", "test3") setElementData(col4, "kills.names", "test4") setElementData(col5, "kills.names", "test9") setElementData(col6, "kills.names", "test5") setElementData(col7, "kills.names", "test6") setElementData(col8, "kills.names", "#ff0000Akai") setElementData(col9, "kills.names", "#00ff00Green") setElementData(col10, "kills.names", "#0000ffBlue") setElementData(col11, "kills.names", "#ff00ff:O knows") function renderTabla() dxDrawImage(screenW - 318 - 10, (screenH - 198) / 2, 318, 198, "bgr.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("Kills on this round", screenW - 318 - 10, (screenH - 188) / 2, (screenW - 318 - 10) + 318, ( (screenH - 188) / 2) + 188, tocolor(255, 255, 255, 255), 0.66, "bankgothic", "center", "top", true, true, true, true, false) --sort the kills by hight value table.sort(tableKills, function (a,b) return tonumber(a) > tonumber (b) end ) if tableKills then for i=1,10 do posY = ((screenH-394)*0.81+(i*screenH*0.02)) dxDrawText(i.."- "..tableNames[i], (screenW - 308 - 10), posY, (screenW - 308 - 10) + 308, ( (screenH - 164) / 2) + 164, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", true, true, true, true, false) dxDrawText("Kills: "..tableKills[i], (screenW - 150 - 10), posY, (screenW - 308 - 10) + 150, ( (screenH - 164) / 2) + 164, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", true, true, true, true, false) end end end function testCols () tableKills = {} tableNames = {} --just pretending loop through players tablaCol = getElementsByType("colshape") for i=1,#getElementsByType("colshape") do colEle = getElementData(tablaCol[i], "kills.actual") colNom = getElementData(tablaCol[i], "kills.names") table.insert(tableKills, i, colEle) table.insert(tableNames, i, colNom) end setTimer(function() addEventHandler("onClientRender", getRootElement(), renderTabla) end, 3000, 1) end --for testing bindKey("5", "down", testCols) Please help!
  17. Check this Infernus: https://cit2.net/index.php?topic=130604.0 It has a texture template. Easy to edit.
  18. It is because the vehiclegrunge256 texture is set over the whole car and not only on a specific part. It's not easy neither imposible, but you can try UV mapping over the zone you want to apply the shader on Zmodeler or 3dMax. Btw, which vehicle are you using for that?
  19. I deleted the dash character and now it works. Thanks. I didn't expected to have problems with that character, should I send a bug report? Because I didn't see anything about that on bugs.mtasa.com
  20. bump Any help? I can't fix it yet... I tried everything I know and I didn't find anything on the forum about this, neither in bugs.mtasa.com
  21. Hi, I got a problem with the "settings" on my script. I set in the meta the following: <settings> <setting name="*skinsPrice" value="2500" group="Price" desc="Set the price of the skins." /> </settings> But when I try to edit the value I got this error: Basically, if I edit one, another setting is created with the value I set, and the old setting is not changed. If I use get() function like this: function saveSkinPrice (skinsResource) if skinsResource ~= getThisResource() then return end local currentSkinPrice = get("skinsPrice") --I use the setElementData to retrieve the value on client side setElementData(resourceRoot, "skins.price", currentSkinPrice ) end addEventHandler("onResourceStart", getRootElement(), saveSkinPrice) function updateSkinPrice(pricesetting, oldprice, newprice) --outputs for testing outputChatBox(pricesetting) outputChatBox(oldprice) outputChatBox(newprice) local currentSkinPrice = get("skinsPrice") setElementData(resourceRoot, "skins.price", currentSkinPrice ) end addEventHandler("onSettingChange", getRootElement(), updateSkinPrice) It retrieve the value from "iG_infernus-skins.skinsPrice" setting, making the setting "skinsPrice" useless. I can only use it to edit the "iG_infernus-skins.skinsPrice" setting, and that doesn't have any sense.
  22. Hi, I just came here to show you guys about how serious is Vortex Servers's support: I have a trouble with my server because its status says "unkown", due that I can't access to my ftp/server console. I just can't believe that 1 week has been passed since that and I don't have a response/fix yet. What is the point of having a categorized priority tickets by "low, medium, high" if you are not going to respond it? If you are going to buy a Vortex's server, just think twice.
  23. Thank you so much for the information, I didn't know the onClientElementStreamIn event. I rebuilt the script and now it works beatiful and all the important is on client side now. local skinShaders = {} addEventHandler("onClientResourceStart",resourceRoot, function () setElementData(localPlayer,"vehicleSkin",false) end ) addEventHandler("onClientElementStreamIn",root, function () if getElementType(source) == "vehicle" then loadVehicleSkins(source) end end ) addEventHandler("onClientVehicleEnter",root, function () loadVehicleSkins(source) end ) function loadVehicleSkins (vehicle) local controllerSkin = getVehicleController(vehicle) if not controllerSkin then return end local playerSkin = getElementData(controllerSkin,"vehicleSkin") if not playerSkin then return end if not skinShaders[playerSkin] then local theTexture = dxCreateTexture("texture"..playerSkin..".png","dxt3") local skinsFX = dxCreateShader("pintura.fx") dxSetShaderValue(skinsFX,"gTexture",theTexture) skinShaders[playerSkin] = skinsFX end engineApplyShaderToWorldTexture(skinShaders[playerSkin],"texture",vehicle) end function unloadVehicleLights(controllerSkin) setElementData(controllerSkin,"vehiclelight",false) end I will add later the triggers for my needs but it works. I hope this would be useful for someone else, and thank you again.
×
×
  • Create New...