Leaderboard
Popular Content
Showing content with the highest reputation on 25/04/20 in Posts
-
Hi today i want to sell my login panel created with html css JS 'web development' it's kinda a MODERN website. if you are interested contact me here or on discord: Ridden#20281 point
-
I see you have optimised the loop cycles to the bone. But there is something you haven't tried yet, which can improve performance of 100 objects to a % of that, depending on the context. In your current code, you are making full cycles, which changes the usage of the resource by the amount of objects. But what if you could only make the necessary cycles? Prepare render cycle | | \/ bone_attach \ / Add each item to the queue, except for the once that are already in the render table, based on a state. QUEUE \ / Loop through 50 items each frame QUEUE [50 elements] \ / Is element streamed in? If YES, then add the item to the render table. If YES or NO, then table.remove. Give the item a state that it is already in the render table. bone_attach_render | | \/ Re-do the cycle after X ms This concept allows you to reduce big looping cycles. Which also allows you to even render 1000 objects, as long as the peds/players are not inside of the same area. These are not all the steps, there are some more which are related to 'destroyed' and 'streamed-out' elements.1 point
-
1 point
-
I've received different results when testing them one at once. In 2019 i had completely different CPU (and bad PC with Windows 7 - now i'm using Windows 10), it was AMD Athlon II x2 2.70 GHz. bone_attach_original stands for main version which uses pairs, and coroutines. bone_attach_2k19 stands for "optimized" version which i was pretty sure, that it works well (seems i was wrong), uses for i = 1, #tableSize do loop, localized math methods, all tables, all resource functions. bone_attach_2k20 stands for version which i've rewrited today. Uses aswell for i = 1, #tableSize do loop, localized math methods, all tables, all resource functions, mostly called functions (setElementPosition/getElementPosition; setElementRotation/getElementRotation), variables inside of functions scope are declared in main one (they aren't recreating every frame, so script just overwrite values - excluding one variable; i've exceeded upvalues limit - they aren't so fast as in function scope, but it's still better solution to overwrite rather than create new ones - correct me if i'm wrong), however - between 2020 version and original; 2019 there's small (?) difference in logic, in newest version i've implemented fix for CJ skin, which uses math.round method (solution from haron4igg - https://forum.multitheftauto.com/topic/57349-help-attachelementtobone/?tab=comments#comment-661478), besides that, data is stored in sub-tables (+ 1 indexing count) - by data i mean attachments, bone 0/T/F offsets. However, i've greatly reduced count of accessing render data. Latest difference between 2020 version and others is that, it doesn't use server-side at all (creates objects via client-side and attach them directly there) Used to be: local element = bone_attach[i][1] local ped = bone_attach[i][2] local attached_x = bone_attach[i][4] local attached_y = bone_attach[i][5] local attached_z = bone_attach[i][6] local attached_rx = bone_attach[i][7] local attached_ry = bone_attach[i][8] local attached_rz = bone_attach[i][9] Now it's: CLocalRenderData = CLocalRenderAttachments[i] local CLocalRenderElement = CLocalRenderData[1] CLocalRenderPed = CLocalRenderData[2] CLocalRenderBone = CLocalRenderData[3] CLocalRenderAttachX = CLocalRenderData[4] CLocalRenderAttachY = CLocalRenderData[5] CLocalRenderAttachZ = CLocalRenderData[6] CLocalRenderAttachRX = CLocalRenderData[7] CLocalRenderAttachRY = CLocalRenderData[8] CLocalRenderAttachRZ = CLocalRenderData[9] IPB results: 50 objects: 100 objects: Maybe i made something wrong, in 2019, honestly, i don't know1 point
-
what, why. I can play video now. This issue https://github.com/multitheftauto/mtasa-blue/issues/1091 has been fixed in https://github.com/multitheftauto/mtasa-blue/pull/13971 point
-
Until We Do Better ... Keep Watching us... MTA:SA CW 1080p 60 fps Link; https://www.youtube.com/watch?v=C4dgE28lTTg&feature=youtu.be1 point
-
1 point
-
1 point
-
Because in the first example, login_box is not defined. So: gui_elements = {} gui_elements["login_box"] = guiCreateWindow(0.39, 0.29, 0.21, 0.43, "", true) gui_elements["user_input"] = guiCreateMemo(0.16, 0.15, 0.66, 0.13, "", true, gui_elements["login_box"]) gui_elements["password_input"] = guiCreateMemo(0.16, 0.30, 0.66, 0.13, "", true, gui_elements["login_box"]) gui_elements["big_button"] = guiCreateButton(0.17, 0.47, 0.43, 0.11, "", true, gui_elements["login_box"]) gui_elements["small_button"] = guiCreateButton(0.68, 0.47, 0.15, 0.12, "", true, gui_elements["login_box"])1 point
-
Hi. So after all i've decided to play with bone attach once again, had to fix CJ skin bug, and decided to squeeze out even more performance CPU: i5-9400F 1 attached object: 100 attached objects:1 point
-
Vc vai precisar ter 1 imagem de cada frame da "animação". No caso uma imagem com aquele quadrado branco em cada posição. (se eu contei certo, 9 imagens) Depois vc coloca todas as imagens em uma table. Com uma variável de contador, vc usa como iterador para mostrar uma imagem diferente a cada frame, em sequência. E claro, um onClientRender pra manter tudo visível na tela. loadingTextures = { -- As imagens precisam estar declaradas no meta.xml. Se for colocar dentro de uma pasta dentro do resource, a pasta precisa estar declarada também. Ex: imagens/loading1.png dxCreateTexture("loading1.png", "dxt1", true), -- Os nomes não importam, mas cada imagem precisa estar na ordem correta nessa table. dxCreateTexture("loading2.png", "dxt1", true), -- Imagem 2. Pode ser acessada com loadingTextures[2] dxCreateTexture("loading3.png", "dxt1", true), -- Imagem 3. dxCreateTexture("loading4.png", "dxt1", true), -- E assim por diante. dxCreateTexture("loading5.png", "dxt1", true), dxCreateTexture("loading6.png", "dxt1", true), -- dxt1 indica compressão máxima da imagem. A qualidade só fica terrível se houver transparência. dxCreateTexture("loading7.png", "dxt1", true), -- O true indica o uso de MipMaps. A imagem fica boa mesmo se for desenhada em vários tamanhos. dxCreateTexture("loading8.png", "dxt1", true), dxCreateTexture("loading9.png", "dxt1", true), -- Imagem 9. } local contador = 1 -- Variável qualquer que vai variar de 1 até #loadingTextures (9). local x, y = guiGetScreenSize() -- x, y recebem a resolução do jogador. Ex: x = 1920, y = 1080. function renderLoading () if (contador <= #loadingTextures) then -- Se o contador for menor ou igual a 9, então: dxDrawImage (0, 0, x, y, loadingTextures[contador]) -- Desenha em tela cheia a imagem que está no loadingTextures[contador]. else contador = 1 -- Reinicia o contador, pois ao chegar aqui, contador seria igual a 10, mas não existe a imagem 10 na sequência. dxDrawImage (0, 0, x, y, loadingTextures[contador]) -- Desenha em tela cheia a primeira imagem da sequência. end contador = contador + 1 -- Antes de passar pro frame seguinte, aumenta o contador em +1. end addCommandHandler ("loading", function (cmd) -- Comando para testes, faz aparecer/sumir a tela de loading em quem usou o comando. if (isRendering) then removeEventHandler ("onClientRender", root, renderLoading) else addEventHandler ("onClientRender", root, renderLoading) end isRendering = not isRendering -- A variável isRendering fica alternando entre True e False a cada vez que o jogador usa /loading end) --[[OBS: Sim, você pode declarar o nome da imagem direto no dxDrawImage, mas seria mais pesado e você teria que fazer gambiarras pra chamar diferentes imagens a cada frame, uma vez que os nomes seriam diferentes. Vale lembrar que onClientRender executa uma vez a cada frame, ou seja, várias vezes por segundo. Não há tempo para ficar carregando e descarregando arquivos. Outra coisa: Recomendo que use imagens em Full HD, pois imagens pequenas irão distorcer bastante se o jogador estiver usando resoluções maiores. A não ser que você não se importe com isso.]]1 point
-
I didn't knew that -1 on dbPoll would make it so it waits until receives a response. I missed that from the wiki. Thanks!1 point
-
a dica principal é primeiro ver se o evento ou método é clientside ou serverside/shared, resumindo os 3 tipos: client/shared/server: client: os scripts clientside são baixados no pc do player, e executados na grande maioria das vezes sem sincronia com os outros, exemplo: setVehicleComponentVisible para esconder componentes do carro, só é visível para o player que solicitou, para ser visto por todos, precisaria de triggers e funções server para sincronizar/ser visível para outros shared: são funções que funcionam tanto em serverside quanto clientside, createObject é um exemplo, a versão client cria um objeto visível só para o player que requisitou, a server é visivel pra todos (em uso normal), as vezes a versão client tem parâmetros diferentes da server, exemplo o setPlayerMoney server: aqui o resultado do método/evento fica visível/disponível pra todos no server, a não ser que vc especifique que seja pra um player ou mais específicos, exemplo: outputChatBox veja no artigo da wiki nos 2 eventos, um tem como primeiro parametro o player, e o outro o veiculo, vc deve ter se confundido com a palavra player que na verdade poderia ser qualquer coisa, os parâmetros vc pode usar qualquer palavra, exemplo server: function vei() outputChatBox("O nome do veículo atual é: "..getVehicleName(source))--o source desse evento é o veiculo que o player entrou (wiki) end addEventHandler("onVehicleEnter", getRootElement(), vei) --outro exemplo: function vei(carroqueentrou) outputChatBox("O nome do veículo atual é: "..getVehicleName(carroqueentrou))--primeiro parametro = o carro que entraram, pode ser qualquer nome end addEventHandler("onPlayerVehicleEnter", getRootElement(), vei) a dica tbm é lembrar que quando é evento, cada um tem seus parâmetros, e vc tbm pode usar o source de cada evento, e quanto usar comandos, tbm muda de server pra client (addCommandHandler)1 point
-
As one of the developers behind SAES:RPG, the server in question appears to not use any leaked scripts from SAES:RPG (I did a brief check). And it's not like SAES has patented / has a trademark on the idea of our gamemode, so anyone is free to make a gamemode in the same general spirit / idea. With that said, I wish you guys the best of luck.1 point
-
1 point
-
Para você entender o tempo, você precisar calcula-lo. TIMER [1] : setTimer(detonateBomb, 5*60*1000 --[[TEMPO]], 1 --[[TOTAL DE LOOP]], thePlayer) [ TEMPO ] 5*60*1000 : 5 x (vezes) 60 = 300 300 x (vezes) 1000 = 300000 Milissegundos --/> Para Saber os Minutos : 300000 divide por 60000 = 5 Minutos [ TOTAL DE LOOP ] 1 : -- Será o TOTAL DE LOOPS Que o TIMER Dará Para Encerrar. OBSERVAÇÃO : Você sabendo que, (60 x 1000 = 60.000 milissegundos ) é igual a 1 Minuto, você saberá sem precisará calcular na calculadora, que (1 minuto x 5 ) = 5 minutos. TIMER [2] : setTimer(resetBank, 90*60*1000 --[[TEMPO]], 1) [ TEMPO ] : 90*60*1000 90 x (vezes) 60 = 5400 5400 x (vezes) 1000 = 5400000 Milissegundos. --/> Para Saber os Minutos : 5400000 divide por 60000 : 90 Minutos Mesma coisa, 60 * 1000 = 1 Minuto x 90 = 90 Minutos. Para você alterar para 2 horas, tem várias formas : setTimer(resetBank, 60000*60*2, 1) -- 60000 é igual 1 Minuto x 60 = 1 Hora x 2 = 2 Horas. setTimer(resetBank, 1000*60*60*2, 1) -- 1000 x 60 = 60000 que é igual a 1 Minuto x 60 = 1 Hora x 2 = 2 Horas. setTimer(resetBank, 1000*60*120, 1) -- 1000 x 60 = 60000 que é igual a 1 Minuto x 120 = 2 Horas. setTimer(resetBank, 7200000, 1) -- 7.200,000 Milessegundos que é igual a 2 Horas. -- Para Saber os Minutos : 7200000 ( Milessegundos ) dividido por 60000 = 120 Minutos divide por 60 Minutos / 2 horas. Espero que consiga tira suas dúvidas !1 point
-
1 point
-
Acesse as configurações dele e remova todas as armas permitidas para o motorista. Dessa forma, somente os passageiros podem usar armas no driveBy.1 point
-
I have uploaded a resource a few days ago and a user has uploaded my resource recently and is taking credit for doing so. (Google translator) Original: https://community.multitheftauto.com/?p=resources&s=details&id=18093 Stolen: https://community.multitheftauto.com/?p=resources&s=details&id=18104 DONE0 points
