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.

      55.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.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.6k
      posts
  3. MTA Community

    1. Scripting

      All Lua scripting topics related to Multi Theft Auto.

      261.6k
      posts
    2. Maps

      Discussions for maps on various gamemodes.

      13.4k
      posts
    3. Resources

      Everything else about resources.

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

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

      674
      posts
    3. Third party GTA mods

      Showcase for single player mods and requests.

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

      3.1k
      posts
  • Posts

    • Ayy I used to work on MTA wayyyyy back when it started and everyone was figuring it out. With all the reverse-engineering and hacking, coding etc it was actually a bit of an adventure. I started working on a multiplayer GTA myself because I wanted it so bad (ill equipped but determined), and ended up joining with some of the early team. Really proud of everyone getting it together and keeping it going. I remember when we first got shooting working and we were all shooting each other outside that Vice City club that was the default spawn point for a while. I'll always remember the feeling of being the first people that ever played multiplayer GTA... wanting it so bad we manifested it. - Personally I just kept programming and doing random game dev stuff, I released a game made in Unreal Engine using the voxel plugin: https://store.steampowered.com/app/1079300/Goblin_Keep/ I felt incapable of supporting the game after release but I did it for the same reason at MTA, I just wanted to do it. Thanks to the team for keeping this going, who all did a lot more work on it than me 😁
    • Hi! I want to make a paintjob system, and I found two examples. What do you think, which one is more performance/fps friendly?  1.: availablePaintJobs = { [480] = { {'remap', 'textures/comet/1.dds'}, {'remap', 'textures/comet/2.dds'}, {'remap', 'textures/comet/3.dds'}, {'remap', 'textures/comet/4.dds'}, {'remap', 'textures/r8/r8_4.dds'}, {'remap', 'textures/lada4.dds'}, {'remap', 'textures/mc13.dds'}, }, [436] = { {'*remap*', 'textures/y5/1.dds'}, {'*remap*', 'textures/y5/2.dds'}, {'*remap*', 'textures/y5/3.dds'}, {'*remap*', 'textures/y5/4.dds'}, {'*remap*', 'textures/y5/5.dds'}, }, [604] = { {'*remap*', 'textures/1.dds'}, {'*remap*', 'textures/2.dds'}, {'*remap*', 'textures/3.dds'}, {'*remap*', 'textures/4.dds'}, {'*remap*', 'textures/5.dds'}, {'*remap*', 'textures/6.dds'}, {'*remap*', 'textures/7.dds'}, }, }; local shaders = {} local elementShaders = {} local textureCache = {} local textureCount = {} local textureSize = 768 function applyShader(texture, img, distance, element) if element then destroyShaderCache(element) end local this = #shaders + 1 shaders[this] = {} shaders[this][1] = dxCreateShader("texturechanger.fx",0,distance,layered) if not textureCount[img] then textureCount[img] = 0 end if textureCount[img] == 0 then textureCache[img] = dxCreateTexture(img) end textureCount[img] = textureCount[img] + 1 shaders[this][2] = textureCache[img] shaders[this][3] = texture if element then if not elementShaders[element] then elementShaders[element] = {shaders[this], img} end end if shaders[this][1] and shaders[this][2] then dxSetShaderValue(shaders[this][1], "TEXTURE", shaders[this][2]) engineApplyShaderToWorldTexture(shaders[this][1], texture, element) end end function destroyShaderCache(element) if elementShaders[element] then destroyElement(elementShaders[element][1][1]) local old_img = elementShaders[element][2] textureCount[old_img] = textureCount[old_img] - 1 if textureCount[old_img] == 0 then destroyElement(elementShaders[element][1][2]) end elementShaders[element] = nil end end addEvent("destroyShaderCache", true) addEventHandler("destroyShaderCache", root, destroyShaderCache) addEventHandler("onClientResourceStart", resourceRoot, function() for k,v in ipairs(getElementsByType("vehicle", root, true)) do local pj = tonumber(getElementData(v, "tuning.paintjob")) or 0 if pj > 0 then addVehiclePaintJob(v, getElementModel(v), pj) end end end) function getVehiclePaintJobs(model) if availablePaintJobs[model] then return #availablePaintJobs[model] else return 0 end end function addVehiclePaintJob(veh, model, id) local pj = availablePaintJobs[model] if pj then local pj = pj[id] if pj then applyShader(pj[1], pj[2], 100, veh) end end end addEvent("addVehiclePaintJob", true) addEventHandler("addVehiclePaintJob", root, addVehiclePaintJob) function removeVehiclePaintJob(veh) if veh then destroyShaderCache(veh) end end addEvent("removeVehiclePaintJob", true) addEventHandler("removeVehiclePaintJob", root, removeVehiclePaintJob) addEventHandler("onClientElementDestroy", getRootElement(), function() if getElementType(source) == "vehicle" then destroyShaderCache(source) end end) addEventHandler("onClientElementStreamIn", getRootElement(), function() if getElementType(source) == "vehicle" then local pj = tonumber(getElementData(source, "tuning.paintjob")) or 0 if pj > 0 then addVehiclePaintJob(source, getElementModel(source), pj) end end end) addEventHandler("onClientElementStreamOut", getRootElement(), function() if getElementType(source) == "vehicle" then destroyShaderCache(source) end end) or 2.: local modelTextures = { [582] = "template", [445] = "remap", [402] = "remap", [400] = "remapsrt8", [555] = "remap", [416] = "remap", [503] = "remap", [580] = "remap", [558] = "remap", [598] = "remap", [458] = "remap", [589] = "remap", [420] = "face", [566] = "bodykit", [518] = "remap", [561] = "remap", [597] = "r_map", [596] = "remap_taurus", [599] = "remap", } local availableTextures = { [1] = "sprinter/1.dds", [2] = "sprinter/2.dds", [3] = "sprinter/3.dds", [4] = "sprinter/4.dds", [5] = "sprinter/5.dds", [6] = "sprinter/6.dds", [7] = "sprinter/7.dds", [8] = "sprinter/8.dds", [9] = "sprinter/9.dds", [12] = "e60/4.dds", [13] = "e60/5.dds", [14] = "e60/m51.dds", [15] = "e60/m52.dds", [16] = "e60/m53.dds", [17] = "e60/m61.dds", [18] = "e60/m63.dds", [19] = "e60/m62.dds", [20] = "250gto/1.dds", [21] = "250gto/2.dds", [22] = "250gto/3.dds", [23] = "250gto/4.dds", [24] = "ambulance/1.dds", [25] = "amggt/1.dds", [26] = "amggt/2.dds", [27] = "amggt/3.dds", [28] = "amggt/4.dds", [29] = "amggt/5.dds", [30] = "amggt/6.dds", [31] = "audirs4/1.dds", [32] = "audirs4/2.dds", [33] = "audirs4/3.dds", [34] = "audirs4/4.dds", [35] = "audirs4/5.dds", [36] = "audirs4/6.dds", [37] = "audirs4/7.dds", [38] = "bmwm3/1.dds", [39] = "bmwm3/2.dds", [40] = "bmwm3/3.dds", [41] = "copcarpj/1.dds", [42] = "copcarpj/2.dds", [43] = "copcarpj/3.dds", [44] = "e250/1.dds", [45] = "e250/2.dds", [46] = "golf/1.dds", [47] = "golf/2.dds", [48] = "golf/3.dds", [49] = "golf/4.dds", [50] = "golf/5.dds", [51] = "viper/1.dds", [52] = "viper/2.dds", [53] = "viper/3.dds", [54] = "viper/4.dds", [55] = "viper/5.dds", [56] = "viper/6.dds", [57] = "viper/7.dds", [58] = "viper/8.dds", [59] = "nissan240/1.dds", [60] = "nissan240/2.dds", [61] = "nissan240/3.dds", [62] = "nissan240/4.dds", [63] = "nissan240/5.dds", [64] = "nissan240/6.dds", [65] = "nissan240/7.dds", [66] = "nissan240/8.dds", [67] = "grandsrt8/1.dds", [68] = "grandsrt8/2.dds", [69] = "grandsrt8/3.dds", [70] = "tahoe/1.dds", [71] = "tahoe/2.dds", [72] = "tahoe/3.dds", [73] = "tahoe/4.dds", [74] = "taurus/1.dds", [75] = "taurus/2.dds", [76] = "taurus/3.dds", [77] = "suburban/1.dds", [78] = "suburban/2.dds", [79] = "suburban/3.dds", [80] = "polmav/1.dds", [81] = "polmav/2.dds", [82] = "polmav/3.dds", [83] = "polmav/4.dds", [84] = "polmav/5.dds", [85] = "f10/1.dds", [86] = "f10/2.dds", [87] = "e34/1.dds", [88] = "e34/2.dds", [89] = "e34/3.dds", } local paintjobs = { ["template"] = { [582] = {1, 2, 3, 4, 5, 6, 7, 8, 9} }, ["bodykit"] = { [566] = {85, 86} }, ["face"] = { [420] = {87, 88, 89} }, ["remap"] = { [402] = {10}, [445] = {12, 13, 14, 15, 16, 17, 18, 19}, [555] = {20, 21, 22, 23}, [416] = {24}, [503] = {25,26,27,28,29,30}, [580] = {31,32,33,34,35,36,37}, [558] = {38,39,40}, [598] = {41,42,43}, [458] = {44,45}, [589] = {46,47,48,49,50}, [518] = {51,52,53,54,55,56,57,58}, [561] = {59,60,61,62,63,64,65,66}, }, ["remapsrt8"] = { [400] = {67,68,69}, }, ["remap_taurus"] = { [596] = {70,71,72,73}, }, ["r_map"] = { [596] = {80, 81, 82, 83, 84}, [597] = {77,78,79}, }, } local textures = {} local shaders = {} addEventHandler("onClientResourceStart", getResourceRootElement(), function () for k, v in pairs(availableTextures) do textures[k] = dxCreateTexture("textures/" .. v, "dxt1") end for k, v in pairs(getElementsByType("vehicle"), getRootElement(), true) do applyTexture(v) end end) addEventHandler("onClientElementStreamIn", getRootElement(), function () if getElementType(source) == "vehicle" then applyTexture(source) end end) addEventHandler("onClientResourceStop", getResourceRootElement(), function () for k, v in pairs(shaders) do if isElement(v) then destroyElement(v) end end for k, v in pairs(textures) do destroyElement(v) end end) addEventHandler("onClientElementDataChange", getRootElement(), function (dataName) if dataName == "vehicle.tuning.Paintjob" then applyTexture(source) end end) addEventHandler("onClientElementDestroy", getRootElement(), function () if shaders[source] then if isElement(shaders[source]) then destroyElement(shaders[source]) end shaders[source] = nil end end) function applyTexture(vehicle) local paintjobId = getElementData(vehicle, "vehicle.tuning.Paintjob") or 0 if paintjobId then if paintjobId == 0 then if isElement(shaders[vehicle]) then destroyElement(shaders[vehicle]) end shaders[vehicle] = nil elseif paintjobId > 0 then local model = getElementModel(vehicle) if not isElement(shaders[vehicle]) then shaders[vehicle] = dxCreateShader("texturechanger.fx") end local modelTexture = modelTextures[model] if modelTexture then local paintjob = paintjobs[modelTexture] if paintjob and paintjob[model] then local textureId = paintjob[model][paintjobId] if textureId and shaders[vehicle] then if textures[textureId] then dxSetShaderValue(shaders[vehicle], "gTexture", textures[textureId]) engineApplyShaderToWorldTexture(shaders[vehicle], modelTexture, vehicle) end end end end end end end function isTextureIdValid(model, textureId) local modelTexture = modelTextures[model] if modelTexture then local paintjob = paintjobs[modelTexture] if paintjob then if paintjob[model] then if paintjob[model][textureId] then return true else return false end else return false end else return false end else return false end end function applyPaintJob(paintjobId, sync) local pedveh = getPedOccupiedVehicle(localPlayer) paintjobId = tonumber(paintjobId) if paintjobId then if isElement(pedveh) then local model = getElementModel(pedveh) if isTextureIdValid(model, paintjobId) or paintjobId == 0 then setElementData(pedveh, "vehicle.tuning.Paintjob", paintjobId, sync) end end end end function getPaintJobCount(model) model = tonumber(model) local modelTexture = modelTextures[model] local paintjob = paintjobs[modelTexture] if model == 467 then return #paintjob[model] - 2 end if model == 500 or model == 438 then return #paintjob[model] - 1 end if model and modelTexture and paintjob and paintjob[model] then return #paintjob[model] end return false end  
    • Hi. Updated the video since I wasn't pleased with the first one 🫠 

Twitter Feed

×
×
  • Create New...