1. Multi Theft Auto: San Andreas 1.x

    1. Support for MTA:SA 1.x

      HELP! HELP! Need help? Post here.
      49,963
      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.

      1
      post
    3. Open Source Contributors

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

      1,196
      posts
    4. Suggestions

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

      7,473
      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.

      439
      posts
  2. General MTA

    1. News

      News and updates on Multi Theft Auto.
      9,384
      posts
    2. Media

      User-made screens and movies go here.

      4,165
      posts
    3. Site/Forum/Discord/Mantis/Wiki related

      Share your comments & concerns about our services.

      5,148
      posts
    4. MTA Chat

      MTA related chat that is NOT support related!
      1,764
      posts
    5. 310,782
      posts
  3. MTA Community

    1. Scripting

      All Lua scripting topics related to Multi Theft Auto.

      244,081
      posts
    2. Maps

      Discussions for maps on various gamemodes.
      12,789
      posts
    3. Resources

      Everything else about resources.
      26,589
      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.

      1,562
      posts
    5. Competitive gameplay

      Discussions about various MTA-related competitive gameplay events. Also gang (clan) forums.
      26,784
      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.
      13,267
      posts
  4. Other

    1. General

      Non-MTA discussions. Anything you want.
      38,086
      posts
    2. Multi Theft Auto 0.5r2

      Discussion regarding Multi Theft Auto 0.5r2 for GTAIII and Vice City.
      607
      posts
    3. Third party GTA mods

      Showcase for single player mods and requests.
      768
      posts
  5. Archive

    1. 144,331
      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,497
      posts
  • Posts

    • <forum was bugged, delete my double comment pls>
    • You may use: addCommandHandler -- to make the command like you've said 'lmute'. getPlayerFromName -- get the player's name from what you've typed in the command. setElementData / setAccountData -- use either of them to give data to the player you want to mute. Then you should modify your local chat script and add a check, it should be something like: if getElementData(...) then return false end   since MTA doesn't have a local chat system he's talking obviously about a custom chat system. You may use: addCommandHandler -- to make the command like you've said 'lmute'. getPlayerFromName -- get the player's name from what you've typed in the command. setElementData / setAccountData -- use either of them to give data to the player you want to mute. Then you should modify your local chat script and add a check, it should be something like: if getElementData(...) then return false end   since MTA doesn't have a local chat system he's talking obviously about a custom chat system.
    • setPlayerMuted isPlayerMuted onPlayerChat cancelEvent For type 0 if local is default chat if not and is a costum command then not put the event 
    • Hi I found a script that throws bombs from this tool but can I help you do how I want it to throw bullets. Client: reloadTime = 100 -- for Seasparrow range = 2 -- To increase range, set this value to 1. To decrease range, use 3. My code is optimized for 2. event = nil fired = false drawHandler = nil armedVehicles = {[601]=true} w, h = guiGetScreenSize() height = nil endY = nil r, g = 255, 0 time = 0 local hmx, hmy, hmz function getPositionFromElementOffset(element,offX,offY,offZ) local m = getElementMatrix ( element ) -- Get the matrix local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z end function onStart() height = math.ceil(h / 50) if height < 19 then height = 19 end endY = math.ceil((h/100)*6) corona = createMarker (0, 0, -10, "corona", 1.0, 200, 100, 0, 150) bindKey ( "ctrl", "down", toggleSeasparrow ) color = tocolor(255, 255, 255, 200) end addEventHandler("onClientResourceStart", resourceRoot, onStart) function entering( thePlayer, seat ) if thePlayer == localPlayer then toggleControl ( "vehicle_fire", true ) toggleControl ( "vehicle_secondary_fire", true ) local model = getElementModel ( source ) if model == 601 then drawHandler = addEventHandler("onClientRender", root, reloadFinished) end if model == 601 then toggleControl ( "vehicle_fire", false ) toggleControl ( "vehicle_secondary_fire", false ) addEventHandler("onClientRender", root, marker) event = true end end end addEventHandler("onClientVehicleEnter", getRootElement(), entering) function exit( thePlayer, seat ) if thePlayer == localPlayer then local model = getElementModel ( source ) if model == 601 then if event ~= nil then removeEventHandler("onClientRender", root, marker) event = nil end toggleControl ( "vehicle_fire", true ) toggleControl ( "vehicle_secondary_fire", true ) end end end addEventHandler("onClientVehicleExit", getRootElement(), exit) addEventHandler("onClientElementDestroy", getRootElement(), function () if (getElementModel(source) == 601 and getVehicleController(source) == localPlayer) then if event ~= nil then removeEventHandler("onClientRender", root, marker) event = nil end toggleControl ( "vehicle_secondary_fire", true ) end end) function wasted() if source == localPlayer then if event ~= nil then removeEventHandler("onClientRender", root, marker) event = nil end toggleControl ( "vehicle_fire", true ) toggleControl ( "vehicle_secondary_fire", true ) end end addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), wasted ) function clientResourceStop() toggleControl ( "vehicle_fire", true ) toggleControl ( "vehicle_secondary_fire", true ) end addEventHandler( "onClientResourceStop", getResourceRootElement(getThisResource()), clientResourceStop ) local muzzleX, muzzleY, muzzleZ local turX, turY, turZ function toggleSeasparrow() if fired == false then if isPedInVehicle ( localPlayer ) and not isCursorShowing() then local veh = getPedOccupiedVehicle ( localPlayer ) if (veh) then if ( getElementModel ( veh ) == 601 ) then fired = true turX, turY, turZ = getElementPosition(veh) local cx,cy,cz = getVehicleComponentPosition( veh, "misc_a" ) local x, y, z = getVehicleComponentPosition( veh, "misc_c" ) local barrelX, barrelY, barrelZ = getPositionFromElementOffset(veh,cx,cy,cz) muzzleX, muzzleY, muzzleZ = getPositionFromElementOffset(veh,x,y,z) local velX = (muzzleX - barrelX) /range local velY = (muzzleY - barrelY) /range local velZ = (muzzleZ - barrelZ) /range local vx, vy, vz = getElementVelocity(veh) setElementVelocity (veh, vx+(((velX/3)*(-1))/50), vy+(((velY/3)*(-1))/50), vz+(((velZ/3)*(-1))/50) ) addEventHandler("onClientRender", root, drawLine) removeEventHandler("onClientRender", root, reloadFinished) drawHandler = nil start = getTickCount() drawHandler = addEventHandler("onClientRender", root, reload) time = 100 soundTimer = setTimer(function() local sound = playSound("LaserSound.wav") setSoundVolume(sound, 1) end, 50, 1) end end end end end local colorR, colorG, colorB = 255, 0, 0 function colorsLasersSeasparrow (command, dataR, dataG, dataB) if dataR and dataG and dataB then if (type(tonumber(dataR)) == "number") and (type(tonumber(dataG)) == "number") and (type(tonumber(dataB)) == "number") then if tonumber(dataR) then if tonumber(dataR) >= 0 and tonumber(dataR) <= 255 then colorR = tonumber(dataR) end end if tonumber(dataG) then if tonumber(dataG) >= 0 and tonumber(dataG) <= 255 then colorG = tonumber(dataG) end end if tonumber(dataB) then if tonumber(dataB) >= 0 and tonumber(dataB) <= 255 then colorB = tonumber(dataB) end end end end end addCommandHandler ("SClaser", colorsLasersSeasparrow) local Texp = 2 function drawLine() dxDrawLine3D ( muzzleX, muzzleY, muzzleZ, hmx, hmy, hmz, tocolor ( colorR, colorG, colorB, 255 ), 10) triggerServerEvent ( "GunveAmmo", localPlayer, hmx, hmy, hmz, Texp ) triggerServerEvent ( "GunveLaser", localPlayer, muzzleX, muzzleY, muzzleZ, hmx, hmy, hmz, colorR, colorG, colorB ) removeEventHandler("onClientRender", root, drawLine) end addEvent ("DrawLaserForAll", true) function DrawLaserForAllPlayers (xi, yi, zi, xf, yf, zf, crL, cgL, cbL) dxDrawLine3D ( xi, yi, zi, xf, yf, zf, tocolor ( crL, cgL, cbL, 255 ), 10) soundTimer2 = setTimer( function() local sound = playSound3D("LaserSound.wav", xf, yf, zf, true) setSoundVolume(sound, 4) setTimer (function () if sound then stopSound ( sound ) end end, 500, 1) end, 50, 1) end addEventHandler ("DrawLaserForAll", getLocalPlayer(), DrawLaserForAllPlayers) function reload() if not isPedInVehicle(localPlayer) then removeEventHandler("onClientRender", root, reload) drawHandler = nil end setMarkerColor ( corona, 255, 0, 0, 100 ) local getTime = (getTickCount()) - start local height = math.ceil(h / 50) if height < 19 then height = 19 end dxDrawRectangle (0, h-endY-height-6, height+6, endY, tocolor(0,0,0,150), false) local endY = math.ceil((h/100)*6) endY = endY - 4 if getTime <= time then endY = (getTime/time)*endY else removeEventHandler("onClientRender", root, reload) drawHandler = nil drawHandler = addEventHandler("onClientRender", root, reloadFinished) if getElementModel(getPedOccupiedVehicle(localPlayer)) ~= 447 then local sfx = playSFX ( "genrl", 136, 72 ) setSoundVolume (sfx, 1) end setMarkerColor ( corona, r, g, 0, 150 ) start = nil fired = false end dxDrawRectangle (2, h-endY-height-8, height+2, endY, tocolor(220,0,0,150), false) end function reloadFinished() if not isPedInVehicle(localPlayer) then removeEventHandler("onClientRender", root, reloadFinished) drawHandler = nil else dxDrawRectangle (0, h-endY-height-6, height+6, endY, tocolor(0,0,0,150), false) dxDrawRectangle (2, h-endY-height-4, height+2, endY-4, tocolor(220,0,0,150), false) end end function marker() if not isPedInVehicle(localPlayer) then removeEventHandler("onClientRender", getRootElement(), marker) if isTimer(soundTimer) then killTimer(soundTimer) end fired = false drawHandler = nil setElementPosition (corona, 0, 0, -10) else local vx, vy, vz = nil, nil, nil local cx, cy, cz = nil, nil, nil local veh = getPedOccupiedVehicle ( localPlayer ) if veh then local x, y, z = getVehicleComponentPosition( veh, "misc_a" ) cx, cy, cz = getPositionFromElementOffset( veh, x, y, z ) x, y, z = getVehicleComponentPosition( veh, "misc_c" ) vx, vy, vz = getPositionFromElementOffset( veh, x, y, z ) if vx ~= nil then local velX = (vx - cx) /range local velY = (vy - cy) /range local velZ = (vz - cz) /range local vx1, vy1 = cx + (velX * 50 * 0.1), cy + (velY * 50 * 0.1) local vx2, vy2 = cx + (velX * 50 * 0.2), cy + (velY * 50 * 0.2) local vx3, vy3 = cx + (velX * 50 * 0.3), cy + (velY * 50 * 0.3) local vx4, vy4 = cx + (velX * 50 * 0.5), cy + (velY * 50 * 0.5) local vx5, vy5 = cx + (velX * 50 * 0.6), cy + (velY * 50 * 0.6) local vx6, vy6 = cx + (velX * 50 * 0.7), cy + (velY * 50 * 0.7) local vx7, vy7 = cx + (velX * 50 * 0.8), cy + (velY * 50 * 0.8) local m1 = cz + (velZ * 50 * 0.1) - ((getGravity()*2400*0.01)/2) local m2 = cz + (velZ * 50 * 0.2) - ((getGravity()*2400*0.04)/2) local m3 = cz + (velZ * 50 * 0.3) - ((getGravity()*2400*0.09)/2) local m4 = cz + (velZ * 50 * 0.5) - ((getGravity()*2400*0.25)/2) local m5 = cz + (velZ * 50 * 0.6) - ((getGravity()*2400*0.36)/2) local m6 = cz + (velZ * 50 * 0.7) - ((getGravity()*2400*0.49)/2) local m7 = cz + (velZ * 50 * 0.8) - ((getGravity()*2400*0.64)/2) local hit, mx, my, mz, elementHit = processLineOfSight (cx, cy, cz, vx1, vy1, m1, true, true, true, true, true, false, false, false, veh) if hit == false then hit, mx, my, mz, elementHit = processLineOfSight (vx1, vy1, m1, vx2, vy2, m2, true, true, true, true, true, false, false, false, veh) if hit == false then hit, mx, my, mz, elementHit = processLineOfSight (vx2, vy2, m2, vx3, vy3, m3, true, true, true, true, true, false, false, false, veh) if hit == false then hit, mx, my, mz, elementHit = processLineOfSight (vx3, vy3, m3, vx4, vy4, m4, true, true, true, true, true, false, false, false, veh) if hit == false then hit, mx, my, mz, elementHit = processLineOfSight (vx4, vy4, m4, vx5, vy5, m5, true, true, true, true, true, false, false, false, veh) if hit == false then hit, mx, my, mz, elementHit = processLineOfSight (vx5, vy5, m5, vx6, vy6, m6, true, true, true, true, true, false, false, false, veh) if hit == false then hit, mx, my, mz, elementHit = processLineOfSight (vx6, vy6, m6, vx7, vy7, m7, true, true, true, true, true, false, false, false, veh) if hit == false then mx, my, mz = vx7, vy7, m7 end end end end end end end local dist = getDistanceBetweenPoints3D ( vx, vy, vz, mx, my, mz ) if dist < 50 then r = 5.1 * dist g = 255 elseif dist >= 50 then r = 255 g = 255 - ((dist-50) * 5.1) end hmx, hmy, hmz = mx, my, mz setElementPosition (corona, mx, my, mz) setMarkerColor ( corona, r, g, 0, 150 ) if not drawHandler then drawHandler = addEventHandler("onClientRender", root, reloadFinished) end end end end end Server: function GunonAmmo ( hitX, hitY, hitZ, Texp ) createGunon ( hitX, hitY, hitZ, Texp, source ) end addEvent( "GunveAmmo", true ) addEventHandler( "GunveAmmo", root, GunonAmmo ) function GunveLaser (muzzleX, muzzleY, muzzleZ, hmx, hmy, hmz, colorR, colorG, colorB) for x,p in ipairs(getElementsByType("player")) do if p ~= source then triggerClientEvent ("DrawLaserForAll", p, muzzleX, muzzleY, muzzleZ, hmx, hmy, hmz, colorR, colorG, colorB) end end end addEvent( "GunveLaser", true ) addEventHandler( "GunveLaser", root, GunveLaser )