Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 22/05/21 in all areas

  1. To post a topic in the Scripting section your topic should meet the following requirements: It must contain specific questions about either: the code you will include that is problematic or you are asking direct support for, or asking for help in finding the best approach to achieve something. For example, asking more experienced scripters if there is a more efficient way of coding your desired script/function. The contents of the topic must focus around code support or coding methods. It needs to follow the Formatting guidelines and Conduct guidelines listed below. This section is not for: (resource) progress show-off, recruiting scripters, or polling interest or brainstorming on what kind of project you are up to next All of the above things have their own categories to post them in. These categories are respectively: https://forum.multitheftauto.com/forum/87-resources/ https://forum.multitheftauto.com/forum/149-looking-for-staff/ https://forum.multitheftauto.com/forum/140-mta-chat/ If you still post such a topic in the Scripting section mistakenly, the first time it will get moved gracefully to the correct section. Any subsequent repeated mistakes may result in an instant deletion of your topic. Formatting guidelines It would be highly appreciated if you tag your topics appropriately and use proper topic titles. Although this is not a hard requirement, it helps to maintain overview. Use the following template for this: [BUG] TOPIC_TITLE - for problematic code that will not work or has issues that you need assistance with. This type of topic must always contain a code snippet of the script in question. Most of the times, you will need to provide the entire script. [QUESTION] TOPIC_TITLE - scripting questions, including (but possibly not limited to): asking for help in understanding scripting principles, function or code usage, or if you wonder whether your approach to achieve something is the most optimal and efficient one. We are all learning and aid from more experienced scripters can be useful. Use code snippet tags. Always add your code (if applicable) in this uniform way. Click the ''< >'' shortcut in the text editor, as seen in below screenshot: Then put your code within the box that said button (< >) creates. Be sure to select Lua for highlighting from the drop-down list in bottom right corner for automatic syntax colouring, wiki links for built-in functions and events and other cool features. Please do not use loose [ code] tags for the sake of readability. Do not mass-quote code snippets, or else it would fill up the whole topic with repeats of the same code over and over again. Remove the code column from a previous quote before posting or limit your own quote by narrowing down the parts of code you are replying about. Quote selectively. Advice Last but not least, please try to explain your issue or question the best way you can. A clean and detailed topic can increase the chance that someone will sit down to analyse your problem and actually help you. Clear communication and description is also the key to attracting scripters who may potentially take a look for you. Note that a common request is to "post the full script" and that isn't without reason - problems often go deeper than you think (or the issue is structural / architectural of nature) and other scripters will find it difficult to help you debug or trace it without having a good picture of everything. Especially with questions regarding bugs or something not working as it's supposed to, you may have low or non-existent outreach from others if you're not providing full code. Similarly, also keep in mind posting screenshots (or lines) from debugscript, errors or warnings, that include the line number, you will need to number any script code you provide in your topic to ensure others can intepret it and find the corresponding erroring lines. Code of Conduct Treat everyone with respect, no matter their skill in scripting. If someone posts what you think is low level/''stupid'', remember that you have once been there as a novice scripter yourself and everyone should have a chance to learn. Instead of resorting to humiliating replies, think about how hard it is to learn how to script efficiently, and dedicate yourself even more to help them understand it. You might play a noticeable role in someone's future as MTA scripter (or who knows, maybe an even more prominent role later on too). Long story short, avoid making remarks or rude comments aimed at someone's skill level, incapabilities, etc. It is not appreciated neither by us Moderators nor by regular users of the forums. The Scripting section is not meant for those unwilling to learn, whose only intent is to try get others to finish the scripts they need, line by line. We see this happening way too often - someone with seemingly zero scripting skills does not react on-topic to the set of functions they can use that other users provide them, and does not seem to take any pushes in the right direction forward; they are just waiting for a collective effort from other scripters to develop what they want. This is what we do not want to see. Do not expect all the work to be done for you while you lean back. You should at least try to script it by yourself - users on this subforum are generally happy to help in any particular issue you come across while coding. If you see someone who keeps bumping their topic that is clearly oriented at letting his work be done by others, then please report the post. The bumping policy in scripting section is a bit different from other forum sections, because scripting topics serve as a sort of knowledge-base for those dealing with the same issue/question as described in existing topics. It is often suggested (and usual practise for many scripters) that prior to posting a new topic, someone searches the forums to see if their question has been asked/answered before. Therefore, you may bump old topics if you're certain your approach or solution/code is better than other posted answers, and if it's a fairly common question (not someone just asking how to have their own code fixed or similar case-specific topics). However, we the moderating team may still review if your posts are really useful bumps with new insights, and even if so, we can lock the topic to prevent derailing of an old topic/continuous posts. So expect your useful bumps to possibly be the last ever made in a certain topic (which means if you do it, do it well). If you believe a popular topic for a really common scripting problem should be unlocked for you to post input, or you wish to improve upon someone's earlier bump after which it was locked, then please use the Report button referring to this part of the regulations. No support is offered for leaked code or scripts (even if they only partially originate from a leak) and such topics will be locked and trashed on sight. If you notice a topic where something related is being asked, or other clandestine requests (such as questions how to decompile scripts, etc, anything with not-so-noble intentions) then please report the topic and do not reply as it may incite unnecessary arguments. Mention the source proving that it is a leaked code within your report, though you can omit that if you feel that it is fairly obvious that the resource/script was leaked. In the latter case however, keep in mind that we may not be aware of such a leak, so the Moderator who handles your report will have to take his judgement upon it if you do not provide evidence. Still, keep in mind that you should not openly accuse users who post pieces of your (or someone else's) code as per https://forum.multitheftauto.com/topic/46410-stolen-resource-accusations/. If this happens, simply report such posts. Failure to abide by the Code of Conduct may result in a forum punishment. If you notice anything that violates the Code of Conduct, please report those posts instead of enforcing the rules yourself. It just takes a few seconds, but greatly benefits the Section and makes it a better place to seek help from.
    1 point
  2. This is what I need, thanks for the help.
    1 point
  3. Eu já te dei a faca e o queijo brother. Você pode utilizar o código que te enviei para TODOS, roupas, veículos, objetos, basta trocar, no caso do veículo, ao invés da variável "ped" você utiliza "vehicle" e o restante é jogo de Textura, substitui o nome da textura, para saber qual substituir basta abrir o TXD e ver o nome da textura. Para objetos use a variavel "object". E para roupas a variavel e "ped" também pois o elemento está integrado ao jogador. Um exemplo de como fazer um sistema de armas : Pegue o modelo de uma arma limpa, sem nenhum attach, pegue o modelo de uma arma com mira, remova a mira dela pelo 3dsMax e coloque no modelo da arma "Limpa". Faça isso com outras partes, carregador, silenciador, basicamente você vai montar um modelo de uma arma completa com todos os attachs utilizando partes de outros modelos, depois jogue as texturas em cima de cada parte, mira, silenciador, carregador, etc... Exporte o dff, e pronto, vc já pode brincar com as texturas utilizando este sistema, colocando texturas invisíveis em todos os attachs e dando a arma apenas com a textura padrão, e ai ao comprar uma mira por exemplo, vc adiciona a textura da mira ao modelo, não sou mt bom pra explicar mais espero que tenha entendido o conceito
    1 point
  4. Procure Rakashy no youtube e veja meus trabalhos com shader, hoje postei uma atualização do meu Custom de personagens, também tenho um sistema de skins de veiculos para Viaturas, e estou trabalhando em um custom de armas para adicionar Miras, silenciadores, carregadores, etc
    1 point
  5. Segue ai meu script, um exemplo do que pode ser feito.
    1 point
  6. Pode usar ai e testar, vai funcionar certinho, ai é só replicar e alterar a textura pra ir adicionando skins, e não se esqueça de sempre desencadear esses eventos via server-side, pois se chamar o evento direto do client, a skin só irá alterar para você
    1 point
  7. Thread's been moved into the Portuguese scripting section for you
    1 point
  8. Hey, Well you can use string.match and check whether there are any uppercase letters. If it returns nill then all the letters are lowercase and everything is good. if string.match(text, '%u') == nil then -- all chars are lowercase else -- an uppercase letter is found end I hope I understood correct what you want to do.
    1 point
  9. function SetarSkin(thePlayer) local ShaderM4 = [[ texture tex; technique replace { pass P0 { Texture[0] = tex; } } ]] local thePlayer = source local ShaderM4_RK = dxCreateShader(ShaderM4, 0, 0, false, "ped") local Texture_M4 = dxCreateTexture("Texturas/M4A1/M4A1-1.png") -- LOCAL AONDE ESTÁ O PNG DA TEXTURA engineApplyShaderToWorldTexture(ShaderM4_RK, "M4A1[057]", thePlayer) -- "M4A1[057]" é o nome da textura no .dff que vai substituir dxSetShaderValue(ShaderM4_RK, "tex", Texture_M4) end addEvent( "RK:DarM4A1-1", true) addEventHandler("RK:DarM4A1-1", getRootElement(), SetarSkin) -- Se chamar este evento com uma M4 na mão irá mudar a skin para o PNG citado. Está aí.. Prontinho pra você. Este vai do lado do client. Então apenas faça um esquema para dar trigger via serverside para a skin ficar visível à todos do servidor. De nada Da um UP aí se ajudei
    1 point
  10. For those who still wonder ? The idea of drawing on top of it with dx functions was actually good and it works! Here is the result from what I tried: This was done by drawing a rectangle with the size of the screen and some text over it and as you can see you can barely see the ***NETWORK TROUBLE*** text. function onGotProblem(status) if status == 0 then -- we got a problem addEventHandler("onClientRender", root, networkWarning) else -- all good removeEventHandler("onClientRender", root, networkWarning) end end addEventHandler("onClientPlayerNetworkStatus", root, onGotProblem) function networkWarning() -- Draw your stuff here dxDrawRectangle(...) dxDrawText(...) end
    1 point
×
×
  • Create New...