Jump to content

Forums

  1. Multi Theft Auto: San Andreas 1.x

    1. Support for MTA:SA 1.x

      HELP! HELP! Need help? Post here.

      52.2k
      posts
    2. User Guides

      These guides are a good place to start learning how to achieve certain things within MTA in an efficient and well mannered way.

      11
      posts
    3. Open Source Contributors

      This space is for contributors to discuss the development of MTA. No user suggestions/support.

      1.2k
      posts
    4. Suggestions

      Suggestions and requests go here. Please note that actual feature requests must be filed on our GitHub.

      7.6k
      posts
    5. Ban appeals

      Use this forum to appeal your GLOBAL MTA:SA bans. Permanent bans only - appeals for timed ones (eg. 24 hours) will be refused.

      Do not use it for appealing server-specific bans as we do not have power over these specific servers.

      1.2k
      posts
  2. General MTA

    1. News

      News and updates on Multi Theft Auto.

      9.5k
      posts
    2. Media

      User-made screens and movies go here.

      4.3k
      posts
    3. Site/Forum/Discord/Mantis/Wiki related

      Share your comments & concerns about our services.

      5.2k
      posts
    4. MTA Chat

      MTA related chat that is NOT support related!

      2k
      posts
    5. 324.1k
      posts
  3. MTA Community

    1. Scripting

      All Lua scripting topics related to Multi Theft Auto.

      254.5k
      posts
    2. Maps

      Discussions for maps on various gamemodes.

      13.1k
      posts
    3. Resources

      Everything else about resources.

      27.7k
      posts
    4. Other Creations & GTA modding

      This section includes things such as GUI themes, forum userbars, user-created MTA logos, etc. Also contains topics which cover general GTA modding areas that can be used in MTA, such as modelling.

      2k
      posts
    5. Competitive gameplay

      Discussions about various MTA-related competitive gameplay events. Also gang (clan) forums.

      26.7k
      posts
    6. Servers

      Looking for a server to play on? Looking for someone to host your server? Looking for a place to discuss with other server owners? Here's where to look.

      14.6k
      posts
  4. Other

    1. General

      Non-MTA discussions. Anything you want.

      38k
      posts
    2. Multi Theft Auto 0.5r2

      Discussion regarding Multi Theft Auto 0.5r2 for GTAIII and Vice City.

      634
      posts
    3. Third party GTA mods

      Showcase for single player mods and requests.

      760
      posts
  5. Archive

    1. 144k
      posts
    2. Trash

      These posts have broken forum rules. They are stored here temporarily so offending users can see what they have done wrong.

      1.9k
      posts
      • Tut
  • Posts

    • Welcome! local connection = exports.dm_mysql:getConnection() function onJoin() local serial = getPlayerSerial(source) local ipadress = getPlayerIP(source) local serialcheck = dbQuery(connection, "SELECT banned FROM accounts WHERE serial = ?", serial) local result = dbPoll(serialcheck, -1) if result and #result == 1 then -- found an account local banned = tonumber(result[1]["banned"]) == 1 -- A Boolean from database is 0 (false) or 1 (true), this will be true if the value 1, false otherwise if banned then outputChatBox("Banned", source) else outputChatBox("Not banned", source) end end end addEventHandler("onPlayerJoin", root, onJoin)  
    • Hello guys! I have a problem with converting dbQuery result. I am trying to ask the database if a colum true or false. I can extract the value in a table with dbPoll, and it frees up the Query as well, but when I try to convert the table value to boolean value it always return nil. I have tryed dbExec, but it gives back true as long as the connection is alive. My main goal is to get a boolean value in a variable. Do you know the solution?   This code gives me a table local connection = exports.dm_mysql:getConnection() function onJoin() local serial = getPlayerSerial(source) local ipadress = getPlayerIP(source) local serialcheck = dbQuery(connection, "SELECT banned FROM accounts WHERE serial = ?", serial) local result = dbPoll(serialcheck, -1) outputChatBox(tostring(result), source) end addEventHandler("onPlayerJoin", root, onJoin) [2021-07-26 15:22:32] [Output] : table: 04470BF8 When I try to extract tha value from the table with the default script, that is in the dbPoll description on MTA:wiki, it gives me nil, doesn't metter if the database store value of 1 ore 0. function onJoin() local serial = getPlayerSerial(source) local ipadress = getPlayerIP(source) local serialcheck = dbQuery(connection, "SELECT banned FROM accounts WHERE serial = ?", serial) local result = dbPoll(serialcheck, -1) outputChatBox(tostring(result), source) if result then for _, row in ipairs ( result ) do -- by using a second loop (use it if you want to get the values of all columns the query selected): for column, value in pairs ( row ) do -- column = the mysql column of the table in the query -- value = the value of that column in this certain row end -- or without a second loop (use it if you want to handle every value in a special way): outputChatBox (tostring(row["column"]), source) -- it will output the value of the column "column" in this certain row end end end addEventHandler("onPlayerJoin", root, onJoin) [2021-07-26 15:35:01] [Output] : nil I had to convert the output to string, because I got warning for bad argument, that it gives me back nil value. [2021-07-26 15:34:21] WARNING: dm_accounts\sourceS.lua:21: Bad argument @ 'outputChatBox' [Expected string at argument 1, got nil]  
    • Hi, This's the wrong section , So if you want someone to make your own gamemode post your request about the scripter here but don't forget to read the section's rules before posting. Or if you want to looking for a free gamemodes you can search here or in the resources section ( resources section some of them are free and some are paid ).  
    • Hello Everyone, Happy Eid.   So I am looking to a new race gamemode for mta server. thx

Twitter Feed

×
×
  • Create New...