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.

      54.8k
      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.3k
      posts
    4. Suggestions

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

      7.7k
      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.

      4.6k
      posts
  2. General MTA

    1. News

      News and updates on Multi Theft Auto.

      9.8k
      posts
    2. Media

      User-made screens and movies go here.

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

      Share your comments & concerns about our services.

      5.5k
      posts
    4. MTA Chat

      MTA related chat that is NOT support related!

      2.1k
      posts
    5. 330.2k
      posts
  3. MTA Community

    1. Scripting

      All Lua scripting topics related to Multi Theft Auto.

      261.1k
      posts
    2. Maps

      Discussions for maps on various gamemodes.

      13.4k
      posts
    3. Resources

      Everything else about resources.

      28.5k
      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.

      2.4k
      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.

      15.6k
      posts
  4. Other

    1. General

      Non-MTA discussions. Anything you want.

      38.1k
      posts
    2. Multi Theft Auto 0.5r2

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

      671
      posts
    3. Third party GTA mods

      Showcase for single player mods and requests.

      810
      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.

      2.5k
      posts
  • Posts

    • local mysql = exports.rp_mysql function setElementDataEx(source, field, parameter, streamtoall, streamatall)     exports.rp_anticheat:changeProtectedElementDataEx( source, field, parameter, streamtoall, streamatall) end function getAllInts(thePlayer, commandName, ...)     if exports.rp_integration:isPlayerAdmin( thePlayer ) then         local interiorsList = {}         local mQuery1 = nil                  dbQuery(             function(qh)                 local res, rows, err = dbPoll(qh, 0)                 if rows > 0 then                     for index, row in ipairs(res) do                         table.insert(interiorsList, { row["iID"], row["type"], row["name"], row["cost"], row["charactername"], row["username"], row["cked"], row["DiffDate"], row["locked"], row["supplies"], row["safepositionX"], row["disabled"], row["deleted"], '', row["iCreatedDate"],row["iCreator"], row["`interiors`.`x`"], row["`interiors`.`y`"], row["`interiors`.`z`"], row['fowner'] } )                     end                     triggerClientEvent(thePlayer, "createIntManagerWindow", thePlayer, interiorsList, getElementData( thePlayer, "account:username" ))                 end             end,         connection, "SELECT factions.name AS fowner, interiors.id AS iID, interiors.type AS type, interiors.name AS name, cost, charactername, username, cked, locked, supplies, safepositionX, disabled, deleted, interiors.createdDate AS iCreatedDate, interiors.creator AS iCreator, DATEDIFF(NOW(), lastused) AS DiffDate, interiors.x, interiors.y, interiors.y FROM interiors LEFT JOIN characters ON interiors.owner = characters.id LEFT JOIN accounts ON characters.account = accounts.id LEFT JOIN factions ON interiors.faction=factions.id ORDER BY interiors.createdDate DESC")     end end addCommandHandler("interiors", getAllInts) addCommandHandler("ints", getAllInts) addEvent("interiorManager:openit", true) addEventHandler("interiorManager:openit", getRootElement(), getAllInts) function delIntCmd(thePlayer, intID )     executeCommandHandler ( "delint", thePlayer, intID ) end addEvent("interiorManager:delint", true) addEventHandler("interiorManager:delint", getRootElement(), delIntCmd) function disableInt(thePlayer, intID )     executeCommandHandler ( "toggleinterior", thePlayer, intID ) end addEvent("interiorManager:disableInt", true) addEventHandler("interiorManager:disableInt", getRootElement(), disableInt) function gotoInt(thePlayer, intID )     executeCommandHandler ( "gotohouse", thePlayer, intID ) end addEvent("interiorManager:gotoInt", true) addEventHandler("interiorManager:gotoInt", getRootElement(), gotoInt) function restoreInt(thePlayer, intID )     executeCommandHandler ( "restoreInt", thePlayer, intID ) end addEvent("interiorManager:restoreInt", true) addEventHandler("interiorManager:restoreInt", getRootElement(), restoreInt) function removeInt(thePlayer, intID )     executeCommandHandler ( "removeint", thePlayer, intID ) end addEvent("interiorManager:removeInt", true) addEventHandler("interiorManager:removeInt", getRootElement(), removeInt)    function forceSellInt(thePlayer, intID )     executeCommandHandler ( "fsell", thePlayer, intID ) end addEvent("interiorManager:forceSellInt", true) addEventHandler("interiorManager:forceSellInt", getRootElement(), forceSellInt) function openAdminNote(thePlayer, intID )     executeCommandHandler ( "checkint", thePlayer, intID ) end addEvent("interiorManager:openAdminNote", true) addEventHandler("interiorManager:openAdminNote", getRootElement(), openAdminNote) function interiorSearch(thePlayer, keyword )     if keyword and keyword ~= "" and keyword ~= "Search..." then         local interiorsResultList = {}         local mQuery1 = nil         dbQuery(             function(qh, thePlayer)                 local res, rows, err = dbPoll(qh, 0)                 if rows > 0 then                     for index, row in ipairs(res) do                         table.insert(interiorsResultList, { row["iID"], row["type"], row["name"], row["cost"], row["charactername"], row["username"], row["cked"], row["DiffDate"], row["locked"], row["supplies"], row["safepositionX"], row["disabled"], row["deleted"], '', row["iCreatedDate"],row["iCreator"], row["`interiors`.`x`"], row["`interiors`.`y`"], row["`interiors`.`z`"], row['fowner'] } )                     end                     triggerClientEvent(thePlayer, "interiorManager:FetchSearchResults", thePlayer, interiorsResultList, getElementData( thePlayer, "account:username" ))                 end             end,         {thePlayer}, mysql:getConnection(), "SELECT factions.name AS fowner, interiors.id AS iID, interiors.type AS type, interiors.name AS name, cost, charactername, username, cked, locked, supplies, safepositionX, disabled, deleted, interiors.createdDate AS iCreatedDate, interiors.creator AS iCreator, DATEDIFF(NOW(), lastused) AS DiffDate, interiors.x, interiors.y, interiors.y FROM interiors LEFT JOIN characters ON interiors.owner = characters.id LEFT JOIN accounts ON characters.account = accounts.id LEFT JOIN factions ON interiors.faction=factions.id WHERE interiors.id LIKE '%"..keyword.."%' OR interiors.name LIKE '%"..keyword.."%' OR factions.name LIKE '%"..keyword.."%' OR cost LIKE '%"..keyword.."%' OR charactername LIKE '%"..keyword.."%' OR username LIKE '%"..keyword.."%' OR interiors.creator LIKE '%"..keyword.."%' ORDER BY interiors.createdDate DESC")     end end addEvent("interiorManager:Search", true) addEventHandler("interiorManager:Search", getRootElement(), interiorSearch) function checkInt(thePlayer, commandName, intID)     if exports.rp_integration:isPlayerTrialAdmin( thePlayer ) then          if not tonumber(intID) or (tonumber(intID) <= 0 ) or (tonumber(intID) % 1 ~= 0 ) then             intID = getElementDimension(thePlayer)             if intID == 0 then                 outputChatBox( "You must be inside an interior.", thePlayer, 255, 194, 14)                 outputChatBox("Or use SYNTAX: /"..commandName.." [Interior ID]", thePlayer, 255, 194, 14)                 return false             end         end         dbQuery(             function(qh, thePlayer)                 local res, rows, err = dbPoll(qh, 0)                 if rows > 0 then                     local result = {}                     for index, row in ipairs(res) do                         table.insert(result, { row["iID"], row["type"], row["name"], row["cost"], row["charactername"], row["username"], row["cked"], row["DiffDate"], row["locked"], row["supplies"], row["safepositionX"], row["safepositionY"], row["safepositionZ"], row["disabled"], row["deleted"], '', row["iCreatedDate"],row["iCreator"], row["`interiors`.`x`"], row["`interiors`.`y`"], row["`interiors`.`z`"], row['fowner'] } )                     end                     dbQuery(                         function(qh, thePlayer)                             local res, rows, err = dbPoll(qh, 0)                             if rows > 0 then                                 local result2 = {}                                 for index, row2 in ipairs(res) do                                     table.insert(result2, { row2["date"], row2["action"], row2["adminname"], row2["logid"], row2["intID"]} )                                 end                                 dbQuery(                                     function(qh, thePlayer)                                         local res, rows, err = dbPoll(qh, 0)                                         if rows > 0 then                                             local notes = {}                                             for index, row2 in ipairs(res) do                                                 row2.creatorname = formatCreator(row2.creatorname, row2.creator)                                                 table.insert(notes, row2 )                                             end                                         end                                         triggerClientEvent(thePlayer, "createCheckIntWindow", thePlayer, result, exports.rp_global:getPlayerAdminTitle(thePlayer), result2, notes)                                     end,                                 {thePlayer}, mysql:getConnection(), "SELECT n.id, n.note, a.username AS creatorname, n.date, n.creator FROM interior_notes n LEFT JOIN accounts a ON n.creator=a.id WHERE n.intid="..intID.." ORDER BY n.date DESC")                             end                         end,                     {thePlayer}, mysql:getConnection(), "SELECT `interior_logs`.`date` AS `date`, `interior_logs`.`intID` as `intID`, `interior_logs`.`action` AS `action`, `accounts`.`username` AS `adminname`, `interior_logs`.`log_id` AS `logid` FROM `interior_logs` LEFT JOIN `accounts` ON `interior_logs`.`actor` = `accounts`.`id` WHERE `interior_logs`.`intID` = '"..intID.."' ORDER BY `interior_logs`.`date` DESC")                 end             end,         {thePlayer}, mysql:getConnection(), "SELECT factions.name AS fowner, interiors.id AS iID, interiors.type AS type, interiors.name AS name, cost, charactername, username, cked, locked, supplies, safepositionX,safepositionY, safepositionZ, disabled, deleted, interiors.createdDate AS iCreatedDate, interiors.creator AS iCreator, DATEDIFF(NOW(), lastused) AS DiffDate, interiors.x, interiors.y, interiors.y FROM interiors LEFT JOIN characters ON interiors.owner = characters.id LEFT JOIN accounts ON characters.account = accounts.id LEFT JOIN factions ON interiors.faction=factions.id WHERE interiors.id = '"..intID.."' ORDER BY interiors.createdDate DESC")     end end addCommandHandler("checkint", checkInt) addCommandHandler("checkinterior", checkInt) addEvent("interiorManager:checkint", true) addEventHandler("interiorManager:checkint", getRootElement(), checkInt) function formatCreator(creator, creatorId)     if creator and creatorId then         if creator == nil then             if creatorId == "0" then                 return "SYSTEM"             else                 return "N/A"             end         else             return creator         end     else         return "N/A"     end end function saveAdminNote(intID, adminNote, noteId )     if not intID or not adminNote then         outputChatBox("Internal Error!", source, 255,0,0)         return false     end     if string.len(adminNote) > 500 then         outputChatBox("Admin note has failed to add. Reason: Exceeded 500 characters.", source, 255, 0, 0)         return false     end     if noteId then         if dbExec(mysql:getConnection(),"UPDATE interior_notes SET note='"..(adminNote).."', creator="..getElementData(source, "account:id").." WHERE id ="..noteId.." AND intid="..intID) then             outputChatBox("You have successfully updated admin note entry #"..noteId.." on interior #"..intID..".", source, 0, 255,0)             addInteriorLogs(intID, "Modified admin note entry #"..noteId, source)             return true         end     else         --outputChatBox("INSERT INTO interior_notes SET note='"..(adminNote).."', creator="..getElementData(source, "account:id")..", intid="..intID )         local insertedId = dbExec(mysql:getConnection(),"INSERT INTO interior_notes SET note='"..(adminNote).."', creator="..getElementData(source, "account:id")..", intid="..intID )          if insertedId then             outputChatBox("You have successfully added a new admin note entry #"..insertedId.." to interior #"..intID..".", source, 0, 255,0)             addInteriorLogs(intID, "Added new admin note entry #"..insertedId, source)             return true         end     end end addEvent("interiorManager:saveAdminNote", true) addEventHandler("interiorManager:saveAdminNote", getRootElement(), saveAdminNote) function restock(thePlayer, commandName, intID, amount)     if exports.rp_integration:isPlayerTrialAdmin(thePlayer) or exports.rp_integration:isPlayerSupporter(thePlayer) then         if not intID or not tonumber(intID) or tonumber(intID)%1~=0 then             amount = 100             intID = getElementDimension(thePlayer)             if intID == 0 then                 outputChatBox( "You must be inside an interior to restock. Or use SYNTAX: /" .. commandName .. " [Interior ID] [Amount 1~300]", thePlayer, 255, 194, 14 )                 return false             end         else             if not amount or not tonumber(amount) or tonumber(amount)%1~=0 or tonumber(amount) < 1 or tonumber(amount) > 300 then                 outputChatBox( "SYNTAX: /" .. commandName .. " [Interior ID] [Amount 1~300]", thePlayer, 255, 194, 14 )                 outputChatBox( "Restocks businesses with supplies.", thePlayer, 255, 100, 0 )                 return false             end         end         local possibleInteriors = getElementsByType("interior")         for _, interior in ipairs(possibleInteriors) do             if tonumber(intID) == getElementData(interior, "dbid") then                 if not exports.rp_integration:isPlayerAdmin(thePlayer) then                     local success, msg1, msg2 = exports["rp_jobs"]:remoteOrderSupplies(thePlayer, intID, amount, true)                     --outputChatBox(msg1,thePlayer, 255, 194, 14)                     outputChatBox(msg2,thePlayer, 255, 194, 14)                     if success then                         return true                     else                         return false                     end                 else                     local amount2 = getElementData(interior, "status")[6] + tonumber(amount)                     local mQuery1 = dbExec(mysql:getConnection(),"UPDATE `interiors` SET `supplies` = '"..amount2.."' WHERE `id` = '"..intID.."'") or false                     if not mQuery1 then                         outputChatBox( "Failed to restock "..getElementData(interior, "name").." (ID#"..intID.."), Database error!", thePlayer, 255, 0, 0 )                         return false                     end                     --exports["interiors"]:reloadOneInterior(tonumber(intID))                     outputChatBox( getElementData(interior, "name").." (ID#"..intID..") has been restocked with "..amount.." supplies.", thePlayer, 0, 255, 0 )                     local adminUsername = getElementData(thePlayer, "account:username")                     local hiddenAdmin = getElementData(thePlayer, "hiddenadmin")                     local adminTitle = exports.rp_global:getPlayerAdminTitle(thePlayer)                     local adminID = getElementData(thePlayer, "account:id")                     if hiddenAdmin == 0 then                         exports.rp_global:sendMessageToAdmins("[INTERIOR]: "..adminTitle.." ".. getPlayerName(thePlayer):gsub("_", " ").. " ("..adminUsername..") has restocked "..getElementData(interior, "name").." (ID#"..intID..") with "..amount.." of supplies.")                     else                         exports.rp_global:sendMessageToAdmins("[INTERIOR]: A hidden admin has has restocked "..getElementData(interior, "name").." (ID#"..intID..") with "..amount.." of supplies.")                     end                     local addLog = dbExec(mysql:getConnection(),"INSERT INTO `interior_logs` (`intID`, `action`, `actor`) VALUES ('"..tostring(intID).."', '"..commandName:gsub("'","''").." with "..amount.." supplies', '"..adminID.."')") or false                     if not addLog then                         outputDebugString("Failed to add interior logs.")                     end                     return true                 end             end         end     end end addCommandHandler("restock", restock, false, false) function setInteriorFaction(thePlayer, cmd, ...)     if exports.rp_integration:isPlayerAdmin(thePlayer) then         if not (...) then             outputChatBox("SYNTAX: /" .. cmd .. " [Faction Name or Faction ID]", thePlayer, 255, 194, 14 )             return         end         local dim = getElementDimension(thePlayer)         if dim < 1 then             outputChatBox("You must be inside an interior to perform this action.", thePlayer, 255, 0, 0 )             return         end         local clue = table.concat({...}, " ")         local theFaction = nil         if tonumber(clue) then             theFaction = exports.rp_pool:getElement("team", tonumber(clue))         else             theFaction = exports.rp_factions:getFactionFromName(clue)         end         if not theFaction then             outputChatBox("No faction found.", thePlayer, 255, 0, 0 )             return         end         local dbid, entrance, exit, interiorType, interiorElement = exports['rp_interiors']:findProperty( thePlayer )         if not isElement(interiorElement) then             outputChatBox("No interior found here.", thePlayer, 255, 0, 0 )             return         end         local can , reason = exports.rp_global:canFactionBuyInterior(theFaction)         if not can then             outputChatBox(reason, thePlayer, 255, 0, 0 )             return          end         local factionId = getElementData(theFaction, "id")         local factionName = getTeamName(theFaction)         local intName = getElementData(interiorElement, "name")         if not dbExec(mysql:getConnection(), "UPDATE interiors SET owner='-1', faction='"..factionId.."', locked=0 WHERE id='" .. dbid .. "'") then             outputChatBox("Internal Error.", thePlayer, 255, 0, 0 )             return         end         call( getResourceFromName( "rp_items" ), "deleteAll", interiorType == 1 and 5 or 4, dbid )         exports.rp_global:giveItem(thePlayer, interiorType == 1 and 5 or 4, dbid)         exports.rp_logs:dbLog(thePlayer, 37, { "in"..tostring(dbid) } , "SETINTFACTION INTERIOR ID#"..dbid.." TO FACTION '"..factionName.."'")         exports['rp_interiors']:realReloadInterior(tonumber(dbid))         triggerClientEvent(thePlayer, "createBlipAtXY", thePlayer, entrance[INTERIOR_TYPE], entrance[INTERIOR_X], entrance[INTERIOR_Y])         exports.rp_global:sendMessageToAdmins("[INTERIOR] "..exports.rp_global:getPlayerFullIdentity(thePlayer).." transferred the ownership of interior '"..intName.."' ID #"..dbid.." to faction '"..factionName.."'.")         return true     end end addCommandHandler("setintfaction", setInteriorFaction, false, false) function setInteriorToMyFaction(thePlayer, cmd)     local factionId = getElementData(thePlayer, "faction")     local factionLeader = getElementData(thePlayer, "factionleader")     if not factionId or not factionLeader or factionId < 1 or factionLeader < 1 then         outputChatBox("You must be a faction leader to perform this action.", thePlayer, 255, 0, 0 )         return     end     local dim = getElementDimension(thePlayer)     if dim < 1 then         outputChatBox("You must be inside an interior to perform this action.", thePlayer, 255, 0, 0 )         return     end     local theFaction = exports.rp_pool:getElement("team", tonumber(factionId))     if not theFaction then         outputChatBox("No faction found.", thePlayer, 255, 0, 0 )         return     end     local dbid, entrance, exit, interiorType, interiorElement = exports['rp_interiors']:findProperty( thePlayer )     if not isElement(interiorElement) then         outputChatBox("No interior found here.", thePlayer, 255, 0, 0 )         return     end     local charId = getElementData(thePlayer, "dbid")     local intStatus = getElementData(interiorElement, "status")     local intName = getElementData(interiorElement, "name")     local factionName = getTeamName(theFaction)     if intStatus[INTERIOR_OWNER] ~= charId then         outputChatBox("You must own this interior to perform this action.", thePlayer, 255, 0, 0 )         return     end     local can , reason = exports.rp_global:canPlayerFactionBuyInterior(thePlayer)     if not can then         outputChatBox(reason, thePlayer, 255, 0, 0 )         return      end     if not dbExec(mysql:getConnection(), "UPDATE interiors SET owner='-1', faction='"..factionId.."', locked=0 WHERE id='" .. dbid .. "'") then         outputChatBox("Internal Error.", thePlayer, 255, 0, 0 )         return     end     call( getResourceFromName( "item-system" ), "deleteAll", interiorType == 1 and 5 or 4, dbid )     exports.rp_global:giveItem(thePlayer, interiorType == 1 and 5 or 4, dbid)     exports.rp_logs:dbLog(thePlayer, 37, { "in"..tostring(dbid) } , "SETINTTOMYFACTION INTERIOR ID#"..dbid.." TO FACTION '"..factionName.."'")     exports['rp_interiors']:realReloadInterior(tonumber(dbid))     triggerClientEvent(thePlayer, "createBlipAtXY", thePlayer, entrance[INTERIOR_TYPE], entrance[INTERIOR_X], entrance[INTERIOR_Y])     exports.rp_global:sendMessageToAdmins("[INTERIOR] "..exports.rp_global:getPlayerFullIdentity(thePlayer).." transferred the ownership of interior '"..intName.."' ID #"..dbid.." to his faction '"..factionName.."'.")     return true end addCommandHandler("setinttomyfaction", setInteriorToMyFaction, false, false) ERROR : [2024-03-29 05:38:52] WARNING: [rooster-db]\rp_interiormanager\server.lua:12: Bad argument @ 'dbQuery' [Expected db-connection at argument 2, got nil] [2024-03-29 05:38:58] WARNING: [rooster-db]\rp_interiormanager\server.lua:12: Bad argument @ 'dbQuery' [Expected db-connection at argument 2, got nil]
    • Game Mode Sale Announcement The game mode is now on sale, and we have important updates to share with you. https://payhip.com/b/Bw8CG Buy Here   retirement from the game. New Updates: Weapon system Bed system Broken weapon system Code look system Character selection system Animals + BOT Login System Inventory System Shop System Wallet System with BTC New weapon skins for VIP membership Above-sleeper name display Tools visibility without killing the sleeper Purchase store with real money Revamped team system Modifications to building appearance Modifications to the entire map Tagging friends to enemies Placing markers on the map according to images shown  
    • DataSystem Links:  Github: https://github.com/PWisniaNE/MTA-SA-DataSystem Authors: P.Wiśnia (https://github.com/PWisniaNE) Rick (https://github.com/httpRick/) Server-Side functions: setCustomData(element,name,variable,key) getCustomData(element,name,key) getAllCustomData(element,key) getElementsByCustomData(name,key) hasCustomData(element, selectedKey, name, variable) removeCustomData(element,name,key) Client-Side functions: getCustomData(element,name) setCustomData(element,name,variable) hasCustomData(element,name,variable) KeyTypes: Server (non-synchronization, data only storage on server) Synced (synchronization with all players) Client (synchronization from server to one player) Group (synchronization from server to group of players)
    • The idea is good: having server data, synced data and private data :+1  
    • You should use client instead of source in the addEventHandler.
×
×
  • Create New...