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.9k
      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.6k
      posts
    4. MTA Chat

      MTA related chat that is NOT support related!

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

    1. Scripting

      All Lua scripting topics related to Multi Theft Auto.

      261.2k
      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.5k
      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.

      672
      posts
    3. Third party GTA mods

      Showcase for single player mods and requests.

      811
      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

    • hi i use west rp gamemode type of the gamemode is social gaming i have a problem with we_accounts (account-system) when i connect to server it not show me the account system to create character and i got a error from consol   luccas_s.lua:284: attemp to concatenate global sserial {a nil value} please help me  
    • Hi, I Want To Use Font Awesome On The Map And Radar I Use CustomBlips ReSource And CustomBlips Code From Wiki https://community.multitheftauto.com/index.php?p=resources&s=details&id=960 https://wiki.multitheftauto.com/wiki/Resource:Customblips I Make A New File Name AND Its 0-Blips And In It  meta.xml <meta> <info author="Khalid Mohammed" name="0-Blips" version="1.0" type="script" /> <script src="client.lua" type="client" /> <script src="server.lua" type="server" /> <file src="Images/Residential.png" /> <file src="Images/Industrial.png" /> <file src="Images/Medical.png" /> <file src="Images/Military.png" /> <script src="icons.lua" type="client" /> <export function="getIcon" type="client" /> <export function="getFont" type="client" /> <export function="getIcons" type="client" /> <export function="drawIcon" type="client" /> <file src="fonts/fontawesome.ttf" /> <file src="fonts/fontawesome_brands.ttf" /> <file src="fonts/roboto.ttf" /> <min_mta_version server="1.5.8" client="1.5.8"></min_mta_version> <download_priority_group>10000</download_priority_group> </meta> client.lua local cache = {} local fonts = { ["roboto"] = true } local debugEnabled = false addEvent("onIconsStart", true) addEventHandler("onClientResourceStart", resourceRoot, function() local count = 0 local startTime = getTickCount() for i, v in pairs(fontawesome) do cache[i] = v count = count + 1 end outputDebugString("[FONTAWESOME] Loaded "..count.." icons! ("..(getTickCount()-startTime).."ms)") triggerEvent("onIconsStart", localPlayer) end) function getIcon(name) if cache[name] then return cache[name] else outputDebugString("[FONTAWESOME] "..name.." icon doesn't exists!") end return "" end function getIcons() return cache end local fontCache = {} function getFont(textOrFont, size, bold) local tex = false if textOrFont == "fontawesome" then tex = true textOrFont = "fa-" elseif textOrFont == "fontawesome_brands" then tex = true textOrFont = "fab-" elseif fonts[textOrFont] then tex = true else tex = getIcon(textOrFont) end if(not bold)then bold = "normal" else bold = "bold" end if(not tex)then return "default", size, bold end if type(tex) == "string" or (type(tex) == "boolean" and tex) then local font = "default" local firstLetters = tostring(textOrFont:sub(0, 3)) if firstLetters == "fab" then font = "fontawesome_brands" elseif firstLetters == "fa-" then font = "fontawesome" elseif fonts[textOrFont] then font = textOrFont end if not fontCache[font] then fontCache[font] = {} end if not fontCache[font][size] then fontCache[font][size] = {} end if not fontCache[font][size][bold] then startTime = getTickCount() fontCache[font][size][bold] = dxCreateFont("fonts/"..font..".ttf", size, bold == "bold") if fontCache[font][size][bold] then if debugEnabled then outputDebugString("[FONTAWESOME] Font <"..font.."> cache ("..size..(", "..bold)..") created! ("..(getTickCount()-startTime).."ms)") end else fontCache[font][size][bold] = "default" outputDebugString("[FONTAWESOME] Font <"..font.."> cache ("..size..(", "..bold)..") failed!") end end fontCache[font][size].lastUse = getTickCount() return fontCache[font][size][bold] else return "default", size, bold end end function drawIcon(x, y, icon, size, color, rx, ry, rz) if(not size)then size = 9 end if(not color)then c = tocolor(0,0,0,255) end dxDrawText(getIcon(icon), x, y, 0, 0, color, 1, getFont(icon, size), "left", "top", false, false, false, false, false, rx or 0, ry or 0, rz or 0) end local debugDraw = false if debugDraw then local sx, sy = guiGetScreenSize() addEventHandler("onClientRender", root, function() local sor = 0 local hely = 0 for i, v in pairs(fontawesome) do drawIcon(20 + (hely*30), 20 + (sor*30), i, 15, tocolor(255,255,255,255)) hely = hely + 1 if(hely>40)then hely = 0 sor = sor + 1 end end end) end -- Military Police Blibs -- LV -- SF -- LS Military_PershingSquare_LosSantos_Blip1 = exports.customblips:createCustomBlip ( 1555.5009765625 , -1675.6103515625, 12, 12, dxDrawText(getIcon("fa-spinner"), sx, sy, 0, 0, tocolor(255, 255, 255), 1, getFont("fontawesome", interpolate), "center", "center"), 0 ) server.lua Nothing In It Need For This Folder icons.lua fontawesome = {     --- SOLID     ["fa-chevron-down"] = "",     ["fa-spinner"] = "",     ["fa-grin-beam-sweat"] = "",     ["fa-gavel"] = "",     ["fa-hand-point-up"] = "",     ["fa-kiwi-bird"] = "",     ["fa-home"] = "",     ["fab-monero"] = "",     ["fab-yelp"] = "",     ["fab-creative-commons-nc-eu"] = "",     ["fab-pied-piper"] = "",     ["fab-gitlab"] = "",     ["fab-cc-jcb"] = "", } Fonts Folder in it fontawesome.ttf fontawesome_brands.ttf roboto.ttf   Images Folder in it No Need For This Folder Residential.png Industrial.png Medical.png Military.png   I Use In client.lua customblip exports.customblips:createCustomBlip ( float worldX, float worldY, int imageWidth, int imageHeight, string imagePath, [float streamRadius = 500] ) So Its Like    Military_PershingSquare_LosSantos_Blip1 = exports.customblips:createCustomBlip ( 1555.5009765625 , -1675.6103515625, 12, 12, "Images/Military.png", 0 ) Its Working In Map And Radar I Want To Change Images To Font Awesome So How to use: 1. Decide if you want the icon for a DX element or a GUI one. 2. Go on https://fontawesome.com/icons?d=gallery and search for the icon that you want (pro/free). 3. Copy the icon UniCode that you want. 4. Now go in your resource and type: local fontAwesomeTable = exports['fontawesome']:transform("Icon UniCode here", "category", ID, fontSize) -- Replace `Icon UniCode here` with the one you want. EX: for youtube icon type `transform("f167", ID)` -- Replace `category` with the one you would like. (Brands, Duotone, Light, Regular, Solid); You can see them on the website -- ID: 1 - DX Elements; 2 - GUI elements -- fontSize is an optional argument -- Replace fontawesome with this resource name -- https://ibb.co/CVz2frq To see where the category and UniCode is -- FOR DX ELEMENTS dxDrawText(fontAwesomeTable[1], x, y, width, height, tocolor(255, 255, 255, 255), 1, fontAwesomeTable[2]) -- FOR GUI ELEMENTS local button = guiCreateButton(x, y, width, height, fontAwesomeTable[1], relative) guiSetFont(button, fontAwesomeTable[2]) 5. You are done! I Now Use CustomBlips Code Military_PershingSquare_LosSantos_Blip1 = exports.customblips:createCustomBlip ( 1555.5009765625 , -1675.6103515625, 12, 12, "Images/Military.png", 0 ) And dxDrawText(getIcon("fa-spinner"), sx, sy, 0, 0, tocolor(255, 255, 255), 1, getFont("fontawesome", interpolate), "center", "center") To Military_PershingSquare_LosSantos_Blip1 = exports.customblips:createCustomBlip ( 1555.5009765625 , -1675.6103515625, 12, 12, dxDrawText(getIcon("fa-spinner"), sx, sy, 0, 0, tocolor(255, 255, 255), 1, getFont("fontawesome", interpolate), "center", "center"), 0 ) Put Its Not Working Can Some One Help Thanks                   I Forget Something I Take The Code From This Code local sx, sy = guiGetScreenSize() addEventHandler("onClientRender", root, function() local interpolate = interpolateBetween(15, 0, 0, 30, 0, 0, getTickCount() / 2000, "SineCurve") dxDrawText(getIcon("fa-spinner"), sx, sy, 0, 0, tocolor(255, 255, 255), 1, getFont("fontawesome", interpolate), "center", "center") end)    
    • Hello, you need an event to trigger your function. You could use onPlayerDamage if your script is server side, or onClientPlayerDamage if its client side.
    • Hello, I'm trying to make a script which checks your health and if it equals to zero, it would write your health in the chat. Code: Code: function health()     if getElementHealth(localPlayer) == 0 then         outputChatBox(getElementHealth(localPlayer))     else         outputChatBox("Your Health is above 0.")     end end But it doesnt really do anything. I have already tried adding the next line under the last end: health() But sadly, didn't work. Thank you if you help me!
    • Hi, I would like the tram to stop at the given coordinates for 5 seconds and then continue to the next ones, it works at the first stop, but then it stops after the coordinates tram = createVehicle(x,y,z) local stops ={ {x = -2265.1001, y = 701.59998, z = 48.3}, {x = -2264.8, y = 1030.9, z = 82.7}, {x = -1986.2, y = 1287.3, z = 6}, {x = -1668.9, y = 1252.6, z = 6}, {x = -1581.3, y = 981.09998, z = 6}, {x = -1779.6, y = 929.09998, z = 23.7}, {x = -2006.3, y = 882, z = 44.3}, {x = -1601.1, y = 840.59998, z = 6.5}, {x = -1681.8, y = 734.09998, z = 20.4}, {x = -1869.3, y = 608.40002, z = 34.1}, {x = -2006.6, y = 154.2, z = 26.5}, {x = -2234.7, y = -70.1, z = 34.2} } local currentStop = 0 local nextStop = 1 local isStopped = false function moveTramToNextStop() if not isElement(tram) then return end local currentX, currentY, currentZ = getElementPosition(tram) local nextX, nextY, nextZ = stops[nextStop].x, stops[nextStop].y, stops[nextStop].z local distance = getDistanceBetweenPoints3D(currentX, currentY, currentZ, nextX, nextY, nextZ) local speed = 0.2 if distance < speed then if not isStopped then isStopped = true setTimer(function() isStopped = false currentStop = nextStop nextStop = (nextStop % #stops) + 1 end, 5000, 1) end else isStopped = false local ratio = speed / distance local newX = currentX + (nextX - currentX) * ratio local newY = currentY + (nextY - currentY) * ratio local newZ = currentZ + (nextZ - currentZ) * ratio setElementPosition(tram, newX, newY, newZ) end end setTimer(moveTramToNextStop, 50, 0)  
×
×
  • Create New...