Jump to content

RaceXtreme

Members
  • Posts

    99
  • Joined

  • Last visited

Everything posted by RaceXtreme

  1. If refreshResource() is integrated in MTA:SA so refreshResources() could be deleted because if one needs to refresh all resources, he just needs a iterator. However, this breaks the avaiable scripts. So what now? If that lua version solves the problem of everyone we could just include it somewhere in the Wiki instead of making mess adding more native functions.
  2. function Skinc (sourcee1) local playerr = getPlayerFromName(sourcee1) if getPlayerTeam ( playerr ) == nil then outputChatBox("The Player is not in a team.") return end ... end This line of code will check if the player's team is nil. If does, he doesn't belong to a team and the function terminates. And if your script isn't executing you commited syntax mistakes, like in the line 3. Try to enable debugging and check the Wiki.
  3. You want every player (X) in the server to view that vehicle skin of a specific player (A), right? When you call engineApplyShaderToWorldTexture, you just applied for that player A on his machine using the vehicle variable. Hence, only him will see his skin. If you need all players to be able to view so you would need to call pintar1 in all server's clients. But if I'm not wrong, the player A's vehicle element just exists if it is streammed in one Player X machine. So in addition, you would need a onClientElementStreamIn event to check whether the Player A's has vehicle appeared in Player X's world and if he has any skin to be applied. Instead to call the costum event pintar1 on the Player A's machine, you need onClientElementStreamIn event instead, where it checks if the source element is a valid player vehicle and whether if his account has the said infernusSkin. If so, apply the shader with engineApplyShaderToWorldTexture.
  4. I've seen a MTA's Team Member (Qaisjp) writting some pages about the project structure like here: https://wiki.multitheftauto.com/wiki/CLuaManager. I don't know if he compiled everything in a single wiki page to help locating them but I found the idea really interesting. If you adress important key-points in your reaseach, don't forget to try writting something about it. I believe it would help people that (maybe) will come later.
  5. Well, there are many reasons to not work. You should tell me exactly what is happening in your game client. Try debugscript command to see what outputs. I've made a test and Npass was nil when "registerReq" was called. Take out the source parameter because it is already set as local variable in that function. Then give it a try: addEventHandler ("registerReq", getRootElement(), function (Nuser, Npass) if (Nuser ~= "" and Nuser ~= nil and Npass ~= "" and Npass ~= nil) then if getAccount (Nuser) then -- checks if account exists with this name outputChatBox ("Já existe uma conta com este nome.", source, 255, 255, 255) return false end local Nacc = addAccount (Nuser, Npass) if Nacc then outputChatBox ("Você se registrou com sucesso! Agora faça seu login..", source, 255, 255, 255) end end end )
  6. Easy, just check the wiki https://wiki.multitheftauto.com/wiki/GetAccount. This function returns false if there's no account with the username specified. So the code looks just like the following: addEventHandler ("registerReq", getRootElement(), function (source, Nuser, Npass) if (Nuser ~= "" and Nuser ~= nil and Npass ~= "" and Npass ~= nil) then if getAccount (Nuser) then -- checks if account exists with this name outputChatBox ("Já existe uma conta com este nome.") return false end local Nacc = addAccount (Nuser, Npass) if Nacc then outputChatBox ("Você se registrou com sucesso! Agora faça seu login..", source, 255, 255, 255) end end end Also, avoid adding events with root element. It is much slower than using an player element, for example.
  7. Yeah, unfortunately lots of this got wrong, including the damn title at the installer. I'm trying to talk to Talidan to correct some of those mistakes at http://translate.mtasa.com/, because we need permission to do it so. In addition, the installer translation (some texts of it) is not from MTA's repository, but from Unsis one. You could send him a PM or join in IRC to find him, get your permission on the site and take some doubts about the translation system. Keep in touch, Race.
  8. Temos também a versão em Portugês: https://wiki.multitheftauto.com/index.php?title=PT-BR/Manual_do_Servidor
  9. Vais ter que fazer você mesmo ou um bom amigo te ajudar. Ninguém vai perder tempo fazendo script para você, só se ganhar realmente algo em troca. Em nosso Wiki já temos um simples tutorial de como começar com isso: https://wiki.multitheftauto.com/wiki/PT-BR/Introdu%C3%A7%C3%A3o_ao_Scripting Divirta-se!
  10. Awesome! OOP really helps in scripting. Every version, new possibilites. Well, about the translation, i need to fix a few things that are cut in configuration window and the ugly title in installation that is caused by Nullsoft itself. However, those corrections will just be applied in next version D:
  11. DNL291 tem razão, o seu problema não está bem explicado. Parece ser um objeto na forma de retângulo mesmo. Como você está usando um tipo de livraria com funções prontas para facilitar seu trabalho, só poderei dar um palpite superficial: elev = display.newRect(250,550,30,50) physics.addBody(elev, "kinematic") addEventHandler ("onClientRender", getRootElement(), updateElevator) function updateElevator () if (elev.y > 550 ) then elev:setLinearVelocity( 0, -180 ) elseif (elev.y < 200 ) then elev:setLinearVelocity( 0, 180 ) end end Geralmente, funções que envolvem movimento de objetos são manipuladas toda vez que o jogador renderiza um quadro. Em outras palavras, uma animação não é feita por uma sequência de imagens?
  12. It didn't work I think that it really impossible to take a screenshot of a window! D: Look at my test, please. It has some comments: http://i.imgur.com/pSptEMJ.jpg Edit: Oh i forgot the code: local root = getRootElement () local resourceRoot = getResourceRootElement (getThisResource ()) local screenWidth, screenHeight = guiGetScreenSize () local screenSource, windowCapture local yourWindow = guiCreateWindow (0.5, 0.5, 0.25, 0.3, "Test", true) -- my window is here -- I've created some scrollbars for controlling the image section u,v when rending! local scroll = guiCreateScrollBar ( 30, 20, 200, 20, true, false, yourWindow) local scroll2 = guiCreateScrollBar ( 30, 55, 200, 20, true, false, yourWindow) addEventHandler ("onClientResourceStart", resourceRoot, function () screenSource = dxCreateScreenSource (screenWidth, screenHeight) assert (screenSource, "Fail to create screen source") end) -- F7 captured my window bindKey ("F7", "down", function () -- of course it will if not guiGetVisible (yourWindow) then return end -- got dxUpdateScreenSource (screenSource) posX, posY = guiGetPosition (yourWindow, false) sizeX, sizeY = guiGetSize (yourWindow, false) windowCapture = dxCreateRenderTarget (sizeX, sizeY, true) assert (windowCapture, "Fail to create render target") showCursor(true) -- set those variables for security reasons prog = 0 prog2 = 0 end) addEventHandler( "onClientGUIScroll", getRootElement(), function () if source == scroll then prog = guiScrollBarGetScrollPosition ( scroll ) elseif source == scroll2 then prog2 = guiScrollBarGetScrollPosition ( scroll2 ) end end) addEventHandler( "onClientRender", root, function() if windowCapture then dxSetRenderTarget (windowCapture) dxDrawImageSection (0, 0, sizeX, sizeY, prog/100 * (3*sizeX), prog2/100 * (3*sizeY), sizeX, sizeY, screenSource) dxSetRenderTarget () dxDrawImage( 50, 50, sizeX, sizeY, windowCapture ) end end)
  13. Hello guys! I'm back again with another problem. Here we go: I'm trying to create a little screenshot of a GUI window with dxUpdateScreenSource. Unfortunately, i think that the screen source doens't render the GUI element even if it is visible. Is there's a way to create a texture element of just the GUI element (not the hole screen) with dxDrawImageSection? Thank you in advance
  14. Blantas, you can try my custom photoshop template file to solve your problem. As I've noticed, others translators have sent costum size images to the MTA translation website and Talidan (the L10n leader) just accepted it. If you desire, here's the download link: http://www.4shared.com/download/zAxc5Kmx/template.psd?tsid=20130703-222948-61e6fddf
  15. Para quem ainda não sabe, o time do MTA divulgou no fórum (dia 20 de maio) um site para que os usuários pudessem contribuir com a tradução do aplicativo. E como era de se esperar, o Português também estava na lista. Hoje, dia 23, a tradução já ficou concluída. Agradeço ao trabalho de nossos caros amigos LooooP, Cadu12, Davidhm e todos os usuários anônimos! Além disso, peço que revisem a tradução para que ela fique melhor ainda antes do lançamento do MTA 1.4. E por fim, uma imagem para dar uma ideia de como ficará o MTA em português:
  16. Common guys! We are finishing the translation for (almost) all languages... Portuguese (Brazil) language: 100% translated And please, one more time, don't forget to open a beta test for translation! Its MTA 1.4 and we want this to be a awesome release. The Portuguese Multi Theft Auto
  17. Lol, it really not going to work because you're messing up with Lua syntax! In order to make a script to heal players in your server, first heal yourself with this book: http://www.lua.org/pil/1.html After this, you can take a look in this script below: And you can use it only in the Client-Side: thePlayer = getLocalPlayer () addEventHandler ("OnResourceStart", getResourceRootElement(), function () theMarker = createMarker ( x, y, z, "cylinder", 0 255 0 ) end) addEventHandler ("OnPlayerMarkerHit", theMarker, function () outputChatBox ("Type /mk to buy 25% of Health") end) ddCommandHandler ( "mk", function () if isElementWithinMarker(thePlayer, theMarker) then local money = getPlayerMoney (thePlayer) local health = getElementHealth (thePlayer) if money >= 1500 and health ~= 200 then takePlayerMoney ( 1500 ) setElementHealth ( thePlayer, health + 25 ) outputChatBox ("You bought 25% of health !") else outputChatBox ("You do not have enough money !") end else outputChatBox ("You're not in the Marker !") end end)
  18. Great job for all translators for making MTA even better so fast! I'm here too helping out with Portuguese translation, but i'm stuck with the .png part. Where can i get HelveticaNeueBd.ttf for download? And what about the people who use accents in the template? they got cut when typing them... And can you guys open a beta test for translating checking... maybe people are translating things where they don't know exactly in with context it will be. So why not? We don't wan't scary things in the release.
  19. This means that the shader has to be applied to all textures related to ped element. Solidsnake14, i think he want the highlighting ped surface shader to be "flashing" every 1 second
  20. So you want to start the shader when typing /drug, huh? Here it is: -- -- c_block_world.lua -- local shaderList = {} local colorizeOff = false function ColorizeShader () -- Version check if getVersion ().sortable < "1.1.0" then return end -- Create shader to test for any errors local testShader, tec = dxCreateShader ( "block_world.fx" ) if not testShader then else -- Create 26 shaders and apply each one to some world textures for c=65,96 do local clone = dxCreateShader ( "block_world.fx" ) engineApplyShaderToWorldTexture ( clone, string.format( "%c*", c + 32 ) ) engineRemoveShaderFromWorldTexture ( clone, "tx*" ) -- Skip doing the grass shaderList[#shaderList+1] = clone end -- Initial colors colorize() end end ---------------------------------------------------------------- -- Do change ---------------------------------------------------------------- function colorize() colorizeOff = not colorizeOff for _,shader in ipairs(shaderList) do local r,g,b = 0,0,0 while r+g+b < 2 do r,g,b = math.random(0.25,1.25),math.random(0.25,1.25),math.random(0.25,1.25) end if colorizeOff then r,g,b = 1,1,1 end dxSetShaderValue ( shader, "COLORIZE", r,g,b ) end end addCommandHandler("droga", ColorizeShader) You should start learning Lua by clicking on this link: https://wiki.multitheftauto.com/index.php?title=PT-BR/P%C3%A1gina_Inicial%20 because you don't know even the basis.
  21. No, its the same thing When you type function MyFunction (), Lua just declare a variable called MyFunction thats refer to a function. The local term will just make this function valid for a pice of code.
  22. Here's the solution: function drugEffect() -- script here end addCommandHandler("droga", function () drugTimer = setTimer ( drugEffect, 1000, 0 ) -- 0 for infinite repetitions end)
  23. Pois é. Está ai a sua tarefa. Dê uma olhada nos scripts de Slothman e tente criar uma extensão para ele. Se você travar em alguma parte, nós estaremos aqui para te ajudar
  24. This resource is very interesting, since it just brings Lua scripting to a GUI interface. It really going to help many people. But a thing that makes me get in doubt is how much complexion it support. Because a huge project containing lot of elements may cause delay on executing tasks, since MTA has to run the FlowEditor. We could notice this clearly when using this tool for creating game modes, since few lines of code seems to be unless. In general i can say that FlowEditor has a great propose on its essence and i really support the idea. As TEDERIs is open to receive users questions, i'll open my mind to him: Why don't turn FlowEditor into Race's dreamed tool? I know you dreamed with this too lol
×
×
  • Create New...