diff --git a/unused/GTA_Fitouts.txt b/unused/GTA_Fitouts.txt new file mode 100644 index 0000000..a312bf8 --- /dev/null +++ b/unused/GTA_Fitouts.txt @@ -0,0 +1,240 @@ +GANG[1] Male +===== OUTFIT DUMP ===== +component 0: drawable=0 texture=0 +component 1: drawable=0 texture=0 +component 2: drawable=0 texture=0 +component 3: drawable=0 texture=0 +component 4: drawable=90 texture=0 +component 5: drawable=0 texture=0 +component 6: drawable=25 texture=0 +component 7: drawable=0 texture=0 +component 8: drawable=1 texture=0 +component 9: drawable=0 texture=0 +component 10: drawable=0 texture=0 +component 11: drawable=1 texture=3 +prop 0: drawable=-1 texture=-1 +prop 1: drawable=-1 texture=-1 +prop 2: drawable=-1 texture=-1 +prop 3: drawable=-1 texture=-1 +prop 4: drawable=-1 texture=-1 +prop 5: drawable=-1 texture=-1 +prop 6: drawable=-1 texture=-1 +prop 7: drawable=-1 texture=-1 +======================= + +GANG[2] Male +===== OUTFIT DUMP ===== +component 0: drawable=0 texture=0 +component 1: drawable=0 texture=0 +component 2: drawable=0 texture=0 +component 3: drawable=19 texture=0 +component 4: drawable=87 texture=2 +component 5: drawable=0 texture=0 +component 6: drawable=24 texture=0 +component 7: drawable=0 texture=0 +component 8: drawable=175 texture=0 +component 9: drawable=17 texture=0 +component 10: drawable=0 texture=0 +component 11: drawable=208 texture=2 +prop 0: drawable=-1 texture=-1 +prop 1: drawable=-1 texture=-1 +prop 2: drawable=-1 texture=-1 +prop 3: drawable=-1 texture=-1 +prop 4: drawable=-1 texture=-1 +prop 5: drawable=-1 texture=-1 +prop 6: drawable=-1 texture=-1 +prop 7: drawable=-1 texture=-1 +======================= + +GANG[3] Male +===== OUTFIT DUMP ===== +component 0: drawable=0 texture=0 +component 1: drawable=0 texture=0 +component 2: drawable=0 texture=0 +component 3: drawable=0 texture=0 +component 4: drawable=35 texture=0 +component 5: drawable=0 texture=0 +component 6: drawable=25 texture=0 +component 7: drawable=0 texture=0 +component 8: drawable=58 texture=0 +component 9: drawable=0 texture=0 +component 10: drawable=0 texture=0 +component 11: drawable=55 texture=0 +prop 0: drawable=46 texture=0 +prop 1: drawable=0 texture=0 +prop 2: drawable=-1 texture=-1 +prop 3: drawable=-1 texture=-1 +prop 4: drawable=-1 texture=-1 +prop 5: drawable=-1 texture=-1 +prop 6: drawable=-1 texture=-1 +prop 7: drawable=-1 texture=-1 +======================= + +GANG[4] male +===== OUTFIT DUMP ===== +component 0: drawable=0 texture=0 +component 1: drawable=0 texture=0 +component 2: drawable=0 texture=0 +component 3: drawable=2 texture=0 +component 4: drawable=0 texture=0 +component 5: drawable=0 texture=0 +component 6: drawable=25 texture=0 +component 7: drawable=0 texture=0 +component 8: drawable=16 texture=0 +component 9: drawable=0 texture=0 +component 10: drawable=0 texture=0 +component 11: drawable=179 texture=0 +prop 0: drawable=-1 texture=-1 +prop 1: drawable=-1 texture=-1 +prop 2: drawable=-1 texture=-1 +prop 3: drawable=-1 texture=-1 +prop 4: drawable=-1 texture=-1 +prop 5: drawable=-1 texture=-1 +prop 6: drawable=-1 texture=-1 +prop 7: drawable=-1 texture=-1 +======================= + +GANG[5] male +===== OUTFIT DUMP ===== +component 0: drawable=0 texture=0 +component 1: drawable=0 texture=0 +component 2: drawable=0 texture=0 +component 3: drawable=1 texture=0 +component 4: drawable=13 texture=2 +component 5: drawable=0 texture=0 +component 6: drawable=15 texture=0 +component 7: drawable=0 texture=0 +component 8: drawable=25 texture=0 +component 9: drawable=0 texture=0 +component 10: drawable=0 texture=0 +component 11: drawable=24 texture=2 +prop 0: drawable=-1 texture=-1 +prop 1: drawable=-1 texture=-1 +prop 2: drawable=-1 texture=-1 +prop 3: drawable=-1 texture=-1 +prop 4: drawable=-1 texture=-1 +prop 5: drawable=-1 texture=-1 +prop 6: drawable=-1 texture=-1 +prop 7: drawable=-1 texture=-1 +======================= + +GANG[1] female +===== OUTFIT DUMP ===== +component 0: drawable=0 texture=0 +component 1: drawable=0 texture=0 +component 2: drawable=9 texture=0 +component 3: drawable=15 texture=0 +component 4: drawable=107 texture=0 +component 5: drawable=88 texture=0 +component 6: drawable=38 texture=2 +component 7: drawable=0 texture=0 +component 8: drawable=2 texture=0 +component 9: drawable=0 texture=0 +component 10: drawable=0 texture=0 +component 11: drawable=171 texture=5 +prop 0: drawable=-1 texture=-1 +prop 1: drawable=-1 texture=-1 +prop 2: drawable=-1 texture=-1 +prop 3: drawable=-1 texture=-1 +prop 4: drawable=-1 texture=-1 +prop 5: drawable=-1 texture=-1 +prop 6: drawable=-1 texture=-1 +prop 7: drawable=-1 texture=-1 +======================= + +GANG[2] female +===== OUTFIT DUMP ===== +component 0: drawable=0 texture=0 +component 1: drawable=0 texture=0 +component 2: drawable=9 texture=0 +component 3: drawable=24 texture=0 +component 4: drawable=90 texture=2 +component 5: drawable=0 texture=0 +component 6: drawable=24 texture=0 +component 7: drawable=111 texture=0 +component 8: drawable=3 texture=0 +component 9: drawable=24 texture=0 +component 10: drawable=74 texture=0 +component 11: drawable=226 texture=15 +prop 0: drawable=-1 texture=-1 +prop 1: drawable=-1 texture=-1 +prop 2: drawable=-1 texture=-1 +prop 3: drawable=-1 texture=-1 +prop 4: drawable=-1 texture=-1 +prop 5: drawable=-1 texture=-1 +prop 6: drawable=-1 texture=-1 +prop 7: drawable=-1 texture=-1 +======================= + +GANG[3] female +===== OUTFIT DUMP ===== +component 0: drawable=0 texture=0 +component 1: drawable=0 texture=0 +component 2: drawable=0 texture=0 +component 3: drawable=0 texture=0 +component 4: drawable=6 texture=0 +component 5: drawable=0 texture=0 +component 6: drawable=25 texture=0 +component 7: drawable=0 texture=0 +component 8: drawable=35 texture=0 +component 9: drawable=0 texture=0 +component 10: drawable=0 texture=0 +component 11: drawable=48 texture=0 +prop 0: drawable=45 texture=0 +prop 1: drawable=0 texture=0 +prop 2: drawable=-1 texture=-1 +prop 3: drawable=-1 texture=-1 +prop 4: drawable=-1 texture=-1 +prop 5: drawable=-1 texture=-1 +prop 6: drawable=-1 texture=-1 +prop 7: drawable=-1 texture=-1 +======================= + +GANG[4] female +===== OUTFIT DUMP ===== +component 0: drawable=0 texture=0 +component 1: drawable=0 texture=0 +component 2: drawable=0 texture=0 +component 3: drawable=4 texture=0 +component 4: drawable=0 texture=0 +component 5: drawable=0 texture=0 +component 6: drawable=24 texture=0 +component 7: drawable=0 texture=0 +component 8: drawable=0 texture=0 +component 9: drawable=0 texture=0 +component 10: drawable=0 texture=0 +component 11: drawable=181 texture=0 +prop 0: drawable=-1 texture=-1 +prop 1: drawable=-1 texture=-1 +prop 2: drawable=-1 texture=-1 +prop 3: drawable=-1 texture=-1 +prop 4: drawable=-1 texture=-1 +prop 5: drawable=-1 texture=-1 +prop 6: drawable=-1 texture=-1 +prop 7: drawable=-1 texture=-1 +======================= + + +GANG[5] female +===== OUTFIT DUMP ===== +component 0: drawable=0 texture=0 +component 1: drawable=0 texture=0 +component 2: drawable=0 texture=0 +component 3: drawable=6 texture=0 +component 4: drawable=23 texture=2 +component 5: drawable=0 texture=0 +component 6: drawable=22 texture=12 +component 7: drawable=0 texture=0 +component 8: drawable=13 texture=7 +component 9: drawable=0 texture=0 +component 10: drawable=0 texture=0 +component 11: drawable=25 texture=5 +prop 0: drawable=-1 texture=-1 +prop 1: drawable=-1 texture=-1 +prop 2: drawable=-1 texture=-1 +prop 3: drawable=-1 texture=-1 +prop 4: drawable=-1 texture=-1 +prop 5: drawable=-1 texture=-1 +prop 6: drawable=14 texture=0 +prop 7: drawable=-1 texture=-1 +======================= diff --git a/unused/dev.lua b/unused/dev.lua new file mode 100644 index 0000000..a745aeb --- /dev/null +++ b/unused/dev.lua @@ -0,0 +1,423 @@ +RegisterCommand("tw_coords_ground", function() + local ped = PlayerPedId() + local c = GetEntityCoords(ped) + local h = GetEntityHeading(ped) + + local found, groundZ = GetGroundZFor_3dCoord(c.x, c.y, c.z + 200.0, 0) + local z = found and groundZ or c.z + + local msg = ("Ground Coords: vector4(%.3f, %.3f, %.3f, %.1f)"):format(c.x, c.y, z, h) + print("^3[turfwar]^7 " .. msg) + + BeginTextCommandThefeedPost("STRING") + AddTextComponentSubstringPlayerName(msg) + EndTextCommandThefeedPostTicker(false, false) +end, false) +RegisterCommand("tw_hudtest", function() + SendNUIMessage({ type="capture:start", turfName="HUD TEST", fill="rgba(255,0,0,0.9)", bg="rgba(255,255,255,0.14)" }) + Wait(250) + SendNUIMessage({ type="capture:set", t=0.5 }) +end) + +RegisterCommand("tw_coords_turf", function() + local ped = PlayerPedId() + local c = GetEntityCoords(ped) + + local found, groundZ = GetGroundZFor_3dCoord(c.x, c.y, c.z + 200.0, 0) + local z = found and groundZ or c.z + + local msg = ("center = vector3(%.3f, %.3f, %.3f),"):format(c.x, c.y, z) + + print("^3[turfwar]^7 " .. msg) + + BeginTextCommandThefeedPost("STRING") + AddTextComponentSubstringPlayerName(msg) + EndTextCommandThefeedPostTicker(false, false) +end, false) + +-- client/dev.lua (or bottom of client/main.lua) + +RegisterCommand("tw_uniform_dump", function() + local ped = PlayerPedId() + if not ped or ped == 0 then return end + + print("^3[turfwar]^7 ===== UNIFORM DUMP START =====") + + -- Components 0..11 + for compId = 0, 11 do + local drawable = GetPedDrawableVariation(ped, compId) + local texture = GetPedTextureVariation(ped, compId) + print(("[turfwar] component: { id=%d, drawable=%d, texture=%d }"):format(compId, drawable, texture)) + end + + -- Props commonly used: 0..2, 6..7 + local propIds = {0,1,2,6,7} + for _, propId in ipairs(propIds) do + local drawable = GetPedPropIndex(ped, propId) -- -1 = none + local texture = GetPedPropTextureIndex(ped, propId) + print(("[turfwar] prop: { id=%d, drawable=%d, texture=%d }"):format(propId, drawable, texture)) + end + + print("^3[turfwar]^7 ===== UNIFORM DUMP END =====") +end, false) +RegisterCommand("tw_uniform_test", function(_, args) + local gangId = tonumber(args[1] or "0") or 0 + print(("^3[turfwar]^7 Testing uniform gangId=%d"):format(gangId)) + ApplyGangUniform(gangId) + ReapplyUniformForSeconds(gangId, 3) +end, false) + + +local twCycleRunning = false + +RegisterCommand("tw_cycle", function(_, args) + local ped = PlayerPedId() + if not ped or ped == 0 then return end + + -- Toggle OFF if already running + if twCycleRunning then + twCycleRunning = false + print("^2[turfwar]^7 Cycling stopped.") + return + end + + if not args[1] then + print("^3[turfwar]^7 Usage:") + print("^3[turfwar]^7 /tw_cycle ") + print("^3[turfwar]^7 /tw_cycle c ") + return + end + + local mode = "prop" + local id + + if args[1] == "c" then + mode = "comp" + id = tonumber(args[2]) + else + id = tonumber(args[1]) + end + + if id == nil then + print("^1[turfwar]^7 Invalid ID.") + return + end + + twCycleRunning = true + print("^3[turfwar]^7 Cycling started. Run /tw_cycle again to stop.") + + CreateThread(function() + if mode == "prop" then + local count = GetNumberOfPedPropDrawableVariations(ped, id) + print(("[turfwar] PROP id=%d count=%d"):format(id, count)) + + for d = 0, count - 1 do + if not twCycleRunning then break end + ClearPedProp(ped, id) + SetPedPropIndex(ped, id, d, 0, true) + print(("[turfwar] prop id=%d drawable=%d"):format(id, d)) + Wait(700) + end + else + local count = GetNumberOfPedDrawableVariations(ped, id) + print(("[turfwar] COMPONENT id=%d count=%d"):format(id, count)) + + for d = 0, count - 1 do + if not twCycleRunning then break end + SetPedComponentVariation(ped, id, d, 0, 0) + print(("[turfwar] comp id=%d drawable=%d"):format(id, d)) + Wait(700) + end + end + + twCycleRunning = false + print("^2[turfwar]^7 Cycling finished.") + end) +end, false) + + +RegisterCommand("tw_showitem", function(_, args) + local ped = PlayerPedId() + if not ped or ped == 0 then return end + + local mode = args[1] -- "c" or "p" + local id = tonumber(args[2]) + local drawable = tonumber(args[3]) + local texture = tonumber(args[4] or "0") or 0 + + if (mode ~= "c" and mode ~= "p" and mode ~= "comp" and mode ~= "prop") or id == nil or drawable == nil then + print("^3[turfwar]^7 Usage:") + print("^3[turfwar]^7 /tw_showitem c [texture]") + print("^3[turfwar]^7 /tw_showitem p [texture]") + return + end + + if mode == "comp" then mode = "c" end + if mode == "prop" then mode = "p" end + + if mode == "c" then + local count = GetNumberOfPedDrawableVariations(ped, id) + if count <= 0 then + print("^1[turfwar]^7 This model has no drawables for that component id.") + return + end + if drawable < 0 or drawable >= count then + print(("^1[turfwar]^7 Invalid component drawable. Range 0..%d"):format(count - 1)) + return + end + + local texCount = GetNumberOfPedTextureVariations(ped, id, drawable) + if texCount > 0 and (texture < 0 or texture >= texCount) then + texture = 0 + end + + SetPedComponentVariation(ped, id, drawable, texture, 0) + print(("[turfwar] SET component id=%d drawable=%d texture=%d (textures=%d)"):format(id, drawable, texture, texCount)) + return + end + + -- mode == "p" + local count = GetNumberOfPedPropDrawableVariations(ped, id) + if drawable < 0 then + ClearPedProp(ped, id) + print(("[turfwar] CLEARED prop id=%d"):format(id)) + return + end + + if count <= 0 then + print("^1[turfwar]^7 This model has no drawables for that prop id.") + return + end + if drawable >= count then + print(("^1[turfwar]^7 Invalid prop drawable. Range 0..%d"):format(count - 1)) + return + end + + local texCount = GetNumberOfPedPropTextureVariations(ped, id, drawable) + if texCount > 0 and (texture < 0 or texture >= texCount) then + texture = 0 + end + + ClearPedProp(ped, id) + SetPedPropIndex(ped, id, drawable, texture, true) + print(("[turfwar] SET prop id=%d drawable=%d texture=%d (textures=%d)"):format(id, drawable, texture, texCount)) +end, false) + +RegisterCommand("tw_hairtest", function() + local ped = PlayerPedId() + if not ped or ped == 0 then return end + + local model = GetEntityModel(ped) + local isFree = (model == joaat("mp_m_freemode_01") or model == joaat("mp_f_freemode_01")) + + print(("[turfwar] hairtest model=%s freemode=%s"):format(tostring(model), isFree and "YES" or "NO")) + + -- Make sure hair is visible (no helmet/hat) + ClearPedProp(ped, 0) + + -- Force a visible haircut refresh + local hairDrawable = GetPedDrawableVariation(ped, 2) + local hairTexture = GetPedTextureVariation(ped, 2) + SetPedComponentVariation(ped, 2, hairDrawable, hairTexture, 0) + + -- Set a VERY obvious color (bright red) + SetPedHairColor(ped, 8, 8) + + -- Read back safely + local c1, c2 = GetPedHairColor(ped) + print(("[turfwar] hairtest after set -> primary=%s highlight=%s (hair drawable=%s tex=%s)") + :format(tostring(c1), tostring(c2), tostring(hairDrawable), tostring(hairTexture))) +end, false) + +RegisterCommand("tw_haircycle", function() + local ped = PlayerPedId() + if not ped or ped == 0 then return end + + ClearPedProp(ped, 0) -- remove hat + + local count = GetNumberOfPedDrawableVariations(ped, 2) + print(("[turfwar] hair drawables available: %d"):format(count)) + + for d = 0, count - 1 do + SetPedComponentVariation(ped, 2, d, 0, 0) + SetPedHairColor(ped, 8, 8) -- bright red + print(("[turfwar] hair drawable=%d color=8"):format(d)) + Wait(700) + end +end, false) + + +RegisterCommand("tw_model", function() + local ped = PlayerPedId() + local m = GetEntityModel(ped) + print(("[turfwar] current ped model hash=%s"):format(tostring(m))) +end, false) + + +print("^2[turfwar]^7 dev_clothing.lua loaded (clothing stepper)") + +local function notify(msg) + BeginTextCommandThefeedPost("STRING") + AddTextComponentSubstringPlayerName(msg) + EndTextCommandThefeedPostTicker(false, false) +end + +-- Step a CLOTHING COMPONENT by +/-1 +-- Usage: /tw_comp +RegisterCommand("tw_comp", function(_, args) + local compId = tonumber(args[1]) + local dir = args[2] + + if compId == nil or (dir ~= "next" and dir ~= "prev") then + notify("Usage: /tw_comp ") + return + end + + local ped = PlayerPedId() + if ped == 0 then return end + + local cur = GetPedDrawableVariation(ped, compId) + local max = GetNumberOfPedDrawableVariations(ped, compId) + + if max <= 0 then + notify(("Component %d has no drawables"):format(compId)) + return + end + + local new = cur + if dir == "next" then + new = (cur + 1) % max + else + new = cur - 1 + if new < 0 then new = max - 1 end + end + + SetPedComponentVariation(ped, compId, new, 0, 0) + notify(("Component %d → drawable %d / %d"):format(compId, new, max - 1)) +end, false) + +-- Step a PROP by +/-1 +-- Usage: /tw_prop +RegisterCommand("tw_prop", function(_, args) + local propId = tonumber(args[1]) + local dir = args[2] + + if propId == nil or (dir ~= "next" and dir ~= "prev") then + notify("Usage: /tw_prop ") + return + end + + local ped = PlayerPedId() + if ped == 0 then return end + + local cur = GetPedPropIndex(ped, propId) + local max = GetNumberOfPedPropDrawableVariations(ped, propId) + + if max <= 0 then + notify(("Prop %d has no drawables"):format(propId)) + return + end + + local new = cur + if dir == "next" then + new = cur + 1 + if new >= max then new = -1 end + else + new = cur - 1 + if new < -1 then new = max - 1 end + end + + ClearPedProp(ped, propId) + if new >= 0 then + SetPedPropIndex(ped, propId, new, 0, true) + end + + notify(("Prop %d → drawable %d"):format(propId, new)) +end, false) + +-- Dump current outfit (components + props) +RegisterCommand("tw_dumpfit", function() + local ped = PlayerPedId() + if ped == 0 then return end + + print("^3[turfwar]^7 ===== OUTFIT DUMP =====") + + for i = 0, 11 do + local d = GetPedDrawableVariation(ped, i) + local t = GetPedTextureVariation(ped, i) + print(("component %d: drawable=%d texture=%d"):format(i, d, t)) + end + + for p = 0, 7 do + local d = GetPedPropIndex(ped, p) + local t = GetPedPropTextureIndex(ped, p) + print(("prop %d: drawable=%d texture=%d"):format(p, d, t)) + end + + print("^3[turfwar]^7 =======================") +end, false) + +-- Step TEXTURE for a COMPONENT +RegisterCommand("tw_tex", function(_, args) + local mode = args[1] -- 'c' or 'p' + local id = tonumber(args[2]) + local dir = args[3] + + if (mode ~= "c" and mode ~= "p") or not id or (dir ~= "next" and dir ~= "prev") then + print("^3[turfwar]^7 Usage:") + print("^3[turfwar]^7 /tw_tex c ") + print("^3[turfwar]^7 /tw_tex p ") + return + end + + local ped = PlayerPedId() + if ped == 0 then return end + + if mode == "c" then + local drawable = GetPedDrawableVariation(ped, id) + local curTex = GetPedTextureVariation(ped, id) + local maxTex = GetNumberOfPedTextureVariations(ped, id, drawable) + + if maxTex <= 0 then + print(("^1[turfwar]^7 Component %d has no textures"):format(id)) + return + end + + local newTex = curTex + if dir == "next" then + newTex = (curTex + 1) % maxTex + else + newTex = curTex - 1 + if newTex < 0 then newTex = maxTex - 1 end + end + + SetPedComponentVariation(ped, id, drawable, newTex, 0) + print(("[turfwar] comp %d texture → %d / %d"):format(id, newTex, maxTex - 1)) + + else -- prop + local drawable = GetPedPropIndex(ped, id) + if drawable < 0 then + print(("^1[turfwar]^7 Prop %d not currently worn"):format(id)) + return + end + + local curTex = GetPedPropTextureIndex(ped, id) + local maxTex = GetNumberOfPedPropTextureVariations(ped, id, drawable) + + if maxTex <= 0 then + print(("^1[turfwar]^7 Prop %d has no textures"):format(id)) + return + end + + local newTex = curTex + if dir == "next" then + newTex = (curTex + 1) % maxTex + else + newTex = curTex - 1 + if newTex < 0 then newTex = maxTex - 1 end + end + + SetPedPropIndex(ped, id, drawable, newTex, true) + print(("[turfwar] prop %d texture → %d / %d"):format(id, newTex, maxTex - 1)) + end +end, false) \ No newline at end of file diff --git a/unused/shop_points.lua b/unused/shop_points.lua new file mode 100644 index 0000000..9d1077f --- /dev/null +++ b/unused/shop_points.lua @@ -0,0 +1,22 @@ +-- shared/config/shop_points.lua +Config = Config or {} +Config.ShopPoints = Config.ShopPoints or {} + +-- One “purchase point” per gang (for now) +-- Later we can change each entry to a list to support 5 points per shop type. +Config.ShopPoints.ByGang = { + [1] = vector3(2458.198, 4975.994, 47.0), + [2] = vector3(152.162, -3189.079, 5.87), + [3] = vector3(451.216, -980.050, 30.69), -- police (reserved for later) + [4] = vector3(68.050, 3658.427, 38.720), + [5] = vector3(97.580, -1292.838, 29.27), +} + +-- Optional labels (purely cosmetic) +Config.ShopPoints.LabelByGang = { + [1] = "O'Neil Shop", + [2] = "Malita Shop", + [3] = "Police Shop (Later)", + [4] = "Lost Shop", + [5] = "Gang 5 Shop", +}