Jump to content

Laxante101

Members
  • Posts

    104
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Laxante101

  1. This seems to be a problem with your PC, when the problem is on the MTA a box appears with the problem, but this is not the case.
  2. Laxante101

    .:The BAR:.

    dude that was in 2013
  3. When the game closes by itself, does anything appear after the crash?
  4. No man, it's real he's simply using a remote control app or something, or he's playing samp
  5. Daha fazla satış elde etmek için discord oluşturmalısınız, mta'larını barındırmak isteyen birkaç kişi, sunucuları için mağaza aramak için discord'u kullanıyor, bu sadece bir öneri
  6. For this you will need to work with shaders, dff, txd, and so on, it is not an easy project
  7. Please specify your problem along with your pastebin, submitting the pastebin without the problem you are facing is a bit difficult to answer.
  8. Hi!, my name is Laxante101, I'm a .Lua developer, And today I will try to help you understand SQlite WHAT IS SQLITE? SQLite is a relational database management system (RDBMS) that does not require a separate server to function. Unlike database systems like MySQL or PostgreSQL, which need an active server process, SQLite is "embedded" (that is, the database is stored in a local file on disk), and operations with they are made directly within the program that uses it. Luckily for us, SQLite is already built into the MTA. This means that you can use SQLite databases directly in your MTA Lua codes without having to install anything additional "external" or configure an external database server. SQLite support is native to MTA, facilitating the use of databases for persistent storage of in game information. It is normally used on servers that do not use the login panel, they use SQlite so their information that would be saved in accounts is now saved in the .db file. Or on servers that don't use the original game money, they create other types of “money” like diamonds, stars which are all saved every day, well that's usually the case IMPORTANT DETAILS • Simplicity: Doesn't require anything other than a notepad • Portabilidade: Data is stored in a single .db file, which makes backup and migration easier. SQlite Global Structure Connect to Database with dbConnect Execute Queries using dbExec to modify data and dbQuery to recover data. 3. Manipulate Results with dbPoll and process the returned data. Connection to the Database the database file can be created automatically when connecting. The database file is saved in the server's root folder. local db = dbConnect("sqlite", "storage.db") or if you want to automatically create a folder for your file, or to save your .db files, if it is not created it creates it automatically, if it is created it just puts the file in the path. local db = dbConnect("sqlite", "db/storage.db") in this case the "db" folder will be created Creating Tablese data, you first need to create tables in the database. This is done using normal SQL commands like consulta local = [[ CREATE TABLE IF NOT EXISTS players ( id INTEGER PRIMARY KEY AUTOINCREMENT , name TEXT , score INTEGER ) ]] dbExec ( db , query ) Create a player table if it doesn't already exist In this case, we are creating a players table with three columns: ID Name Score Table Structure TEXT: STRINGS INTEGER: STORAGE NUMBERS REAL:STORES FLOATING POINT NUMBERS BLOB: STORES BINARY DATA (images, files). NULL: NIL VALUE If you don't understand what a string or Boolean values are, learn about data types VIDEO HERE Entering Data To add data to the database we use the SQL command INSERT INTO function AddPlayerLX1(name, score) local query = "INSERT INTO jogadores (name, score) VALUES (?, ?)" dbExec(db, query, name, score) end AddPlayerLX1("juninho", 100) The INSERT INTO command inserts a new player with the name "juninho" and score 100 into the players table. Note: The question marks (?) are placeholders for the values that will be passed to dbExec. This helps prevent SQL injection. Deleting Data To remove data from the database, we use the SQL DELETE command DELETE function DeletePlayerLX2(name) local query = "DELETE FROM players WHERE name = ?" dbExec(db, query, name) end DeletePlayerLX2("juninho") Error Handling It is important to verify that database operations were successful. MTA doesn't automatically return detailed errors other than "/debugscript (1, 2, 3)" so let's add checks. function AddPlayerLX3(name, score) local query = "INSERT INTO jogadores (name, score) VALUES (?, ?)" local sucess = dbExec(db, query, name, score) if sucess then outputDebugString("Sucess.") else outputDebugString("Error.") end end IF SUCESS THEN the success variable stores the result of the dbExec function. If the SQL command execution was successful (i.e. the player was added to the database), success will be true. If success is true, the code inside the if block will be executed. else If the success value is false (that is, if the player's insertion fails for some reason, such as an error in the database connection or SQL query), the code inside the else block will be executed Optimizations and Best Practices Optimizations are great for your day-to-day life as a developer, this makes your code more beautiful, less likely to give you server overload errors, etc... Remember to use dbFree to flush queries after use, especially if you are not using dbPoll. local LX4 = dbQuery(db, "SELECT * FROM players") dbFree(LX4) There are several ways to create clean code, I left just one of them Let's be clear: Since the SQLite database is a flat file, you can back it up by simply copying the .db file. To restore the database, simply replace the old file, this is a big advantage of using SQlite instead of using external databases. OBS: All codes were made based on an example of player name and id points, not made in a real project. (just to make it clear That's all I remembered, if there's anything I didn't make clear here you can say it and I'll edit it or respond to you
  9. Sorry man, my browser's translator automatically translates and sends it wrong.
  10. In dxDrawRectangle you are using screenWidth and screenHeight, which are probably the dimensions of the screen, but your render target has a size defined by window.windowWidth and window.headerHeight. You are using math_min(window.colors.alpha, 100) and math.min(window.colors.alpha, 250) in different parts of your rendering. you are trying to render the window header to a dxRenderTarget. When calling dxSetRenderTarget you are projecting at the correct size and when a projected window appears, it is being called within onClientRender correctly. Don't forget to call dxSetRenderTarget() at the end of the window.drawHeader() function. Fix your code. janela = {} janela.windowWidth = 600 janela.headerHeight = 600 janela.renderTarget = { mainHeader = dxCreateRenderTarget(janela.windowWidth, janela.headerHeight, true) } janela.cores = { alfa = 0 } janela.currentAlpha = 0 janela.fadeDuration = 1000 janela.isVisible = false janela.isHandlerAdded = false function lxfunction1() dxSetRenderTarget(janela.renderTarget.mainHeader, true) dxDrawRectangle(0, 0, janela.windowWidth, janela.headerHeight, tocolor(10, 10, 10, math.min(janela.cores.alfa, 100))) dxDrawImage(0, 0, janela.windowWidth, janela.headerHeight, "path_to_texture.png", 0, 0, 0, tocolor(30, 30, 30, math.min(janela.cores.alfa, 250))) dxSetRenderTarget() end function lxfunction2() local now = getTickCount() local elapsedTime = now - janela.fadeStartTime local progress = math.min(elapsedTime / janela.fadeDuration, 1) janela.currentAlpha = interpolateBetween(janela.fadeStartAlpha, 0, 0, janela.targetAlpha, 0, 0, progress, "Linear") janela.cores.alfa = math.floor(janela.currentAlpha) if janela.renderTarget.mainHeader then dxDrawImage(janela.headerX, janela.headerY, janela.windowWidth, janela.headerHeight, janela.renderTarget.mainHeader) end if progress == 1 and not janela.isVisible and janela.currentAlpha == 0 then removeEventHandler("onClientRender", root, lxfunction2) janela.isHandlerAdded = false end end function lxfunction3(state) janela.isVisible = state janela.targetAlpha = state and 255 or 0 janela.fadeStartTime = getTickCount() janela.fadeStartAlpha = janela.currentAlpha if not janela.isHandlerAdded then addEventHandler("onClientRender", root, lxfunction2) janela.isHandlerAdded = true end end bindKey("H", "down", function() lxfunction1() lxfunction3(true) end) bindKey("H", "up", function() lxfunction3(false) end)
  11. Laxante101

    SERIAL HELP

    For this to happen, the SEEMTA account system is via SQL and someone cloned your serial number.
  12. Also your signature has a mistake I think, I think you didn't put it on purpose
  13. try compile openSSL from source sudo apt install build-essential checkinstall wget https://www.openssl.org/source/openssl-1.1.1k.tar.gz tar -xzvf openssl-1.1.1k.tar.gz cd openssl-1.1.1k ./config make sudo make install when finished restart the server
  14. try installing OpenSSL 1.1 directly. Run the following commands in the terminal to add the Ubuntu package repository that contains OpenSSL 1.1, and then install the library sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update sudo apt install libssl1.1 After installation, check if the libssl.so.1.1 library is present on your system with the command ls -l /lib/x86_64-linux-gnu/libssl.so.1.1
  15. SERVER SIDE function applyWeaponPropertiesToPlayer(player, weaponID) triggerClientEvent(player, "laxaevent", resourceRoot, weaponID) end addCommandHandler("setMP5Mode", function(player, command, mode) local weaponID = 29 -- MP5 if mode == "default" then applyWeaponPropertiesToPlayer(player, weaponID) elseif mode == "pro" then applyWeaponPropertiesToPlayer(player, weaponID) end end ) CLIENT SIDE addEvent("laxaevent", true) addEventHandler("laxaevent", root, function(weaponID) if weaponID == 29 then setWeaponProperty(29, "pro", "weapon_range", 100) setWeaponProperty(29, "pro", "target_range", 25) setWeaponProperty(29, "pro", "accuracy", 100) setWeaponProperty(29, "pro", "damage", 15) setWeaponProperty(29, "pro", "maximum_clip_ammo", 60) setWeaponProperty(29, "pro", "flag_type_dual", false) end end ) Since weapon properties are client-side only, you need to ensure that when reloading or switching weapons, the player retains the correct properties. This can be done using the
  16. Laxante101

    gta3.img

    There are no errors in the gta3.img file reading, you must be facing an AC problem that blocks non-original gta3.img (DS #20) Download the original gta3.img here
  17. MTADiag points out three non-standard files in your GTA fontes.dat fontes.txd americano.gxt These files can cause performance issues, especially if they are not compatible with the MTA version or if they are infected.
  18. vale mencionar que a visualização de tabulações pode variar entre diferentes plataformas, o que pode causar formatação inesperada ao compartilhar código. Enquanto algumas configurações interpretam uma tabulação como quatro espaços, outras podem interpretá-la como oito, o que prejudica a apresentação do código. Portanto, usar espaços é uma solução eficaz para evitar esses problemas.A legibilidade e a manutenção do código são outros pontos cruciais. Um código bem formatado, com indentação consistente, não apenas melhora a legibilidade, mas também facilita a manutenção, especialmente em projetos colaborativos onde várias pessoas estão envolvidas. A indentação clara ajuda a identificar blocos de código, como loops e condicionais, tornando-o mais compreensível. Ferramentas de comparação de código, como o Git, podem ser úteis para identificar diferenças de formatação, permitindo que você veja onde espaços e tabulações foram misturados e facilitando correções. é interessante notar que as preferências sobre o uso de espaços e tabulações podem variar entre equipes e comunidades. Algumas preferem tabulações por razões históricas, enquanto outras adotam espaços devido à consistência e legibilidade.
  19. You may consider disabling engine sounds globally, but this will affect all vehicles. setWorldSoundEnabled(-1, false)
  20. você pode tentar usar setBrowserRenderingPaused(theBrowser, true) para pausar a renderização do navegador antes de destruí-lo. Isso pode ajudar a resolver o problema. Edit: I didn't see that they had mentioned that,
×
×
  • Create New...