Leaderboard
Popular Content
Showing content with the highest reputation on 18/12/19 in all areas
-
If you meant damage model, then yes it's inside the DFF. Looking at http://hotmist.ddo.jp/id/vnode.html you can see _dam variants for damagable parts. Example: "bonnet_ok" is the regular bonnet (not damaged), and "bonnet_dam" is the damaged one. That's the damage model for said part. So by creating a mesh for and renaming it to _dam (if your vehicle has no damage model yet), you can add a damage model. I would advise just copying the _ok mesh, as then it's the right proportions and you can easily deform the mesh (like, twist the steel of the regular bonnet, so it's a damaged variant). But as you're not very clear, if you were talking about collision, then just follow Tut's link.2 points
-
function getFrontPosition(element,dist) local x, y, z = getElementPosition(element) local _,_,r = getElementRotation(element) local tx = x + - ( dist ) * math.sin( math.rad( r ) ) local ty = y + dist * math.cos( math.rad( r ) ) local tz = z return tx,ty,tz end2 points
-
O que é? Pra que serve? Um banco de dados é onde ficam salvos diversos tipos de dados que são usados entre as sessões dos jogadores e do servidor, isto significa que mesmo se o jogador relogar no servidor ou até mesmo o servidor reiniciar, os dados salvos no banco de dados não são perdidos. (se o script que salvou lá foi feito corretamente). O que posso salvar neles? O MTA já cria 2 bancos de dados padrão quando vc cria seu servidor, são eles: internal.db - Onde são salvos todos os dados das contas dos jogadores, login, senha, grana do bolso, posição do jogador quando deslogou, vida, colete, skin, armas, munição, etc. registry.db - Onde são salvos todos os dados que são utilizados pelos resources, como por exemplo melhores pontuações das corridas (race gamemode), proprietários das casas, dados bancários dos jogadores, saldo bancário dos jogadores, carros comprados pelos jogadores, roupas compradas pelos jogadores, empresas adquiridas pelos jogadores, etc. Onde eles estão? Estes dois bancos de dados estão na pasta deathmatch do seu servidor, estão na linguagem SQLite. Você ainda pode criar outros bancos de dados externos, para serem usados pelos resources, mas na minha opinião isso não é recomendável, uma vez que vc usaria MySQL, que é mais complexo e exige certos cuidados de acesso e domínio, mas alguns servidores profissionais precisam fazer assim pois fizeram os bancos de dados ficarem fora do servidor em outro IP por segurança, dai é necessário ter bancos de dados externos. Nesse tutorial vamos tratar somente dos bancos de dados nativos do MTA, por serem mais fáceis de entender. Como mexo neles? Para salvar alguma coisa na conta do jogador, isto é, no internal.db, você usa setAccountData, e para obter esses dados depois, use getAccountData. É extremamente simples, funciona da mesma forma que um setElementData, mas em vez de salvar uma data temporária em um elemento, salva uma data permanente numa conta. Porém, para salvar alguma coisa no registry.db, é um pouco mais complicado, uma vez que vc vai precisar criar uma tabela nova para cada resource. Por exemplo, vc acabou de criar um resource de ranking por kills/deaths e você deseja salvar esse ranking no banco de dados para que ao reiniciar o resource ou o servidor, o ranking não seja perdido. Para isso vc vai precisar primeiramente criar uma tabela no banco de dados registry.db, essa tabela será acessada pelo resource, que irá salvar os dados dele lá. Para fazer qualquer coisa neste banco de dados (criar tabelas, inserir, alterar, remover, deletar, inserir colunas em determinada tabela, etc) vc vai precisar usar isso: executeSQLQuery. Aqui, será necessário conhecimento em SQL para fazer isso, mas é mais fácil do que aprender uma linguagem de programação nova, pois suas opções e sintaxes são menores do que uma linguagem inteira de programação, você não vai inventar nenhum sistema novo aqui, apenas criar e gerenciar tabelas e dados. Criar tabela nova no banco de dados: (o Caps Lock não é uma regra, mas é melhor para entender o que é código e o que é nome) [Os seguintes códigos só funcionam server-side] executeSQLQuery ("CREATE TABLE IF NOT EXISTS nomedatabela (nomecoluna1 TEXT, nomecoluna2 REAL, nomecoluna3 INTEGER)") TEXT = Valores desta coluna serão textos. Podem ter símbolos, números e espaços. REAL = Valores desta coluna serão numéricos reais. (números decimais, positivos, negativos e 0.0) INTEGER = Valores desta coluna serão numéricos inteiros. (positivos, negativos e 0) (não existe tipo BOOLEAN, use TEXT e insira valor "false" ou "true") (existe valor NULL, é diferente de vazio e diferente de 0. NULL significa ausência de dados. O NULL aparece quando você cria uma linha ou coluna nova sem atribuir valores a elas.) Deletar tabela do banco de dados: executeSQLQuery ("DROP TABLE nomedatabela") Todas as linhas, colunas, células e valores desta tabela são deletados junto. Deletar linhas da tabela: (as células não ficarão NULL) executeSQLQuery ("DELETE FROM nomedatabela WHERE colunaespecífica=?", valorDaCelulaEspecifica) O ? indica que o valor está após a declaração do SQL. Você poderia colocar o valor direto no lugar do ?. Mas por alguma razão, as vezes isso gera erro. Além disso, se o valor da célula estiver em uma variável no seu script, você não pode declarar a variável no lugar do ?. Ali só pode ser o valor direto, pois a declaração SQL inteira se trata de uma string. Por isso o uso do ?, que está recebendo o valor da variável que está depois da vírgula. Obs: Para verificar se uma célula tem valor nulo, não se usa os operadores lógicos de ==, <= >=. Para isso, usa-se IS NULL ou IS NOT NULL. Ex: executeSQLQuery ("DELETE nomecoluna1,nomecoluna2 FROM nomedatabela WHERE nomecoluna3 IS NULL") Isso vai deletar todas as células da coluna 1 e coluna 2 onde a coluna 3 tem uma célula de valor NULL. Se a coluna 3 não tiver nenhuma célula de valor NULL, nada acontece. Inserir nova linha de valores: (ele vai criar automaticamente uma nova linha com novas células) executeSQLQuery ("INSERT INTO nomedatabela(nomecoluna1,nomecoluna2,nomecoluna3) VALUES(?,?,?)", valorCelulaColuna1, valorCelulaColuna2, valorCelulaColuna3) Neste caso, ele está inserindo 3 novos valores, cada valor em uma coluna. Se você não declarar os nomes das colunas, ele vai preencher na ordem das colunas automaticamente. Você pode deixar de declarar uma coluna se não quiser atribuir valor na célula daquela coluna. Se o tipo de valor da variável não for do tipo de dado daquela coluna, dará erro. Atualizar valores de células que já existem em uma tabela: (não é possível alterar os tipos de valores, é necessário editar o tipo da coluna se quiser fazer isso) executeSQLQuery ("UPDATE nomedatabela SET nomecoluna2=?,nomecoluna3=? WHERE nomecoluna1=?", valorCelulaColuna2, valorCelulaColuna3, valorCelulaColuna1) No caso acima, ele vai atualizar as células das colunas 2 e 3 onde o valor da célula da coluna 1 for igual ao valor de valorColunaCelula1. OBS: Nada impede que você coloque as primeiras variáveis junto à declaração SQL, mas para fazer isso você deve "cortar" a string, inserir as variáveis e depois continuar a string, Ex: executeSQLQuery ("UPDATE nomedatabela SET nomecoluna2= '".. valorCelulaColuna2 .."',nomecoluna3='".. valorCelulaColuna2 .."' WHERE nomecoluna1=?", valorCelulaColuna1) Lembrando que o valor destas variáveis também são strings na declaração, portanto use aspas simples antes e depois de cada corte para transformar os valores em string. Os dois pontos (..) significam que estes valores fazem parte do argumento SQL. Da mesma forma, se vc usar "1" .. "1", será igual a "11". (Por isso acho muito mais fácil deixar tudo ? na declaração SQL e colocar as variáveis todas após a string.) Selecionar determinadas células da tabela: (usado geralmente para obter os valores destas células para usar no script, você pode selecionar somente 1 célula ou várias) executeSQLQuery ("SELECT nomecoluna1,nomecoluna2 FROM nomedatabela WHERE nomecoluna3=?", valorCelulaColuna3) Neste exemplo, ele vai selecionar a célula da coluna 1 e a célula da coluna 2, na linha onde a célula da coluna 3 for igual a valorCelulaColuna3. Alterar a tabela (adicionar coluna nova) [SQLite não suporta deletar coluna nem editar tipo de coluna] executeSQLQuery ("ALTER TABLE nomedatabela ADD nomecoluna4 REAL") Devido a limitações do SQLite, ALTER TABLE não pode ser usado para deletar uma coluna nem para editar seu tipo. Para fazer isso é necessário recriar a tabela inteira com as novas alterações. No exemplo acima, ele vai adicionar uma nova coluna chamada "nomecoluna4". Tá, mas como ficaria tudo isso dentro de um script? Fiz um código com vários testes de banco de dados. Cada comando faz alguma coisa. É possível mexer em um banco de dados manualmente sem usar scripts? Sim, é possível. Eu mesmo costumo fazer isso para corrigir algumas coisas rápidas sem precisar programar mais nada. Para poder abrir os bancos de dados (internal.db e registry.db) você deve usar um programa chamado DB Browser for SQLite. Um programa gratuito, leve e bem fácil de entender. Nele você consegue acessar todas as tabelas do banco de dados e editar os valores como se fosse em uma planilha do Excel. Basta ir na aba Navegar dados, selecionar a tabela que deseja modificar, clicar em cima da célula cujo valor deseja atualizar, digitar o novo valor, clicar em Aplicar e depois clicar em Escrever modificações (salvar banco de dados). Pronto! E tem mais! Se você já tiver conhecimento avançado com a linguagem SQL, você também pode fazer alterações avançadas via código dentro do programa. Basta acessar a aba Executar SQL, escrever o comando SQL corretamente e depois clicar no botão de Play. Espero ter ajudado.1 point
-
Bueno, me he tomado la pequeña molestia de comprender como se instala correctamente la gamemode de paradise, para ello recurri al antiguo video de la instalacion de dicha gm. Solo que hubiera sido el tutorial perfectp si me hubuera enseñado a no ser baneado y aparte a evitar la pantalla negra que nos crea al no tener la tabla de characters. Asi mismo a crear facciones y demas. Por ello decidi hacer un tutorial completamente nuevo para explicar en realidad como se instala para no tener fallas al querer iniciar el servidor. Espero haber ayudado a mas de uno con este tutorial y exitos en sus nuevos proyectos. https://youtu.be/MRG7KHVSV7s1 point
-
Já consegui ^^, mais obrigado todos vocês por me ajudar1 point
-
Começa pela função attachElements, mas o resource bone_attach pode ser útil pra isso.1 point
-
1 point
-
Uuuuh wee! It works like a charm! Thank you!1 point
-
Introduction A collision model is used by the game to understand the impact between two entities to then calculate physics. These models are physical based, opposed to game models which are visual based. A collision model can generate particles when interacted with by being assigned surface materials. This guide is 3D modeling based and does not cover any procedures that require scripting. Table of Contents Importing collision models from the base game Patching and correcting default game collisions Primitives and why they're beneficial General limitations Surface materials Volumetric shadows Vehicle collisions Importing collision models from the base game Collision files from the base game are stored in large collision archives. These archives have the ability to stores numerous collision files, although custom archives aren't compatible with MTA. In order to find these files, it is recommended to have extracted all game models. Reading the section Extracting game assets on this thread is necessary as a first step. An easy way of extracting all game collisions is to extract entire gta3.img into a new folder. Then, run Steve M's Collision Editor and import all .col files stored in the new folder. Once imported, select all contents and right click -> export single collisions to yet another new folder. This folder will now contain all collisions from gta3.img, with the same name as their .dff model. This makes it easy to make adjustments to both DFF and COL of an object. Another way of getting the name and location of an object's collision is using SAMP Editor. Simply double clicking the object shows the name of the collision and which .col it's stored inside. It's possible to have an instance of MTA running and then open SAMP Editor, by having a separate gta sa installation specifically for SAMP Editor. Collision files are named according to their area in the map, where lae_1 is Los Santos East part 1. Although SAMP Editor option is often better, Prineside also offers a way of getting to know the collision name. Clicking any object on Prineside shows its IDE name (item definition) which is the same name used for the collision file. For instance, ID 16003 drvin_ticket belongs in countn2.ide - this means that its collision is stored in countn2_1-20.col (has 20 files from that area). Finding which one contains collision-model drvin_ticket is like finding the needle in a haystack. Using Steve M's Collision Editor may speed up the process of finding the file containing the collision model. Using collisions from the base game and then modifying can be beneficial as they're often very optimised, and uses a lot more materials for both material brightness and various different surface properties. Such results may take a lot longer than one wishes to spend on a collision. Most collision models comes with primitives which are great to use and is explained in next part. Patching and correcting default game collisions Mappers might often enough come across of furniture objects which pivots around empty air rather than the corner or center of mass. Rockstar did this a lot, especially for beds. As if this wasn't the only issue, Rockstar actually added several broken collisions to the game leading to blue hell (void). These can be patched by 3D modelers. To get started with patching a broken collision model, find and load in vegasw_4.col to 3ds Max by following the above part of the guide. Scroll through and locate downvgnbild1 and import said collision. The problem with downvgnbild1's collision is that the store windows can be climbed over, as the ceiling and walls are nor solid. Every Default's are primitives - that is spheres or boxes. They can be adjusted in height, width, length and radius as well as segments. In this case, from bottom, number 4 and number 5 Default are models that represents the store windows - which are the ones causing the glitch. What exactly causes the glitch? The collision primitives representing the store windows are not tall enough to cover the walls, which essentially means anything can sneak through the gaps. From bottom to top, the 4th Default needs be raised in Z from a value of 3,8659m to 7,2524m. Exact same procedure needs be done for 5th Default. Now the collision is solid in every way, preventing characters from climbing in behind the store windows. To export this collision, follow below steps. Open COL IO. Where it says Export Setting ensure COL3 is highlighted. This is required for GTA SA collisions. The collision contains a collision mesh named CM_downvgnbild1. This must be registered as mesh by clicking the button Collision Mesh and then clicking the CM_downvgnbild1. Same procedure for Shadow Mesh if it has any (this doesn't). The Collision Mesh button should now read as CM_downvgnbild1. In the scene, select everything that's part of the collision. On COL IO there's a text field above the button Export. Here the collision model's name can be defined. Just name it downvgnbild1. Hit Export and find a place to save it. The file can be named anything the user likes. Primitives and why they're beneficial Most 3D applications has a library of basic 3D models; primitives. They are common shapes which on creation can have their quality modified and then remodeled afterwards. For GTA San Andreas, collisions support Box and Sphere as collision primitives. Primitives costs a lot less in terms of file sizes, as example, the below sphere's collision model would be 10.4 kb with collision mesh sphere, and 140 bytes with collision primitive sphere - both collision results are equal. Tall buildings with lots of details e.g support beams tend to use collision primitives as otherwise the collision would sky rocket in file size and polyrates. Some warehouses even use primitives for their gates, exterior fences and walls, while the more complex base models requires a collision mesh. Primitives are named 'Default', though, on export they can be named anything. General limitations Collision models has certain limits which may explain crashes and strange behavior of models. Collision models can be a maximum of 512 height, 512 width and 512 length. In short, a 512 radius sphere or cube would reach the dimensions limit. Polygon rates of collision meshes (not to be confused with primitives!) should reach no more than 3000. In cases of such high rates, the modeler should either split into multiple files or optimise the mesh further. A collision file can contain up to 65535 spheres, boxes and faces. Collision archives are not supported in MTA unlike in GTA. There are cases where invisible collisions appear even after following the rules of thumb for exporting collisions. Isolated edges and vertices can be contributors to invisible collision walls. For reproduction steps follow this Discord channel link to MTA discord. Surface materials GTA SA engine uses materials for collisions. These materials define what type of surface that the model represents. Kam's COL MTL has 179 ID's. Ranging from tarmac, destroyed tarmac, dry mud, wet mud to sea floor and grass. These surface properties generate sound fx and particle fx when walked, driven or shot upon. Collision material also has brightness setting, where 0 is dark and 150+ is bright. Entities affected by this setting are peds and vehicles. The below spoiler contains a list of all surface materials and their ID's. Volumetric shadows World objects and vehicles are able to cast shadows - dynamic ones. These are meshes stored inside the collision file. Generally the shadow mesh should be slightly smaller than the game mesh, as otherwise it'll glitch on the corners of the model. The setting to display shadows are found in MTA video settings. Vehicle collisions Where world objects uses separate .col files, vehicles require their collisions to be embedded or baked in the DFF. These collision models consists of mostly spheres but may also be found to contain boxes and of course their collision mesh (prefixed CM_vehicleName). The collisions use spheres due to the engine's ease of calculating physics with those primitives. They are named that of the material Brightness/Part section, e.g Boot or Rear bumper. Ones that are not used by vehicle components are named Default. In below screenshot, the white lines represents the collision mesh of a Tornado. Usually the collision meshes will suffice with 12 faces total for the hood, windshields, roof, boot and bottom.1 point
-
افكار قادمة لمجتمع العرب تطبيق تواصل اجتماعي جديد ( ثريد ) سيتم الاعلان عنه قريبا موقع مختلفه تماما تقدم خدمات مجانية 22 لعبتين على الجوال قادمة بافكار جديدة واخيرا ماننسى هاللعبه البطلة متجر كامل لمساعدة المبرمجين للعبه لبيع موداتهم ماباتهم الخ وسيتم تسهيل الدفع ويتم توفير تطبيق تم نشره سابقاً وحنا يامجتمع العرب مابناخذ منك ريال مقابل خدماتك اللي تنزله , كامل الربح لك بالتوفيق للجميع , وانتظرونا1 point