Jump to content

RaceXtreme

Members
  • Posts

    99
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

RaceXtreme's Achievements

Punk-@ss B*tch

Punk-@ss B*tch (12/54)

1

Reputation

  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:
×
×
  • Create New...