Advertisement
Guest User

Untitled

a guest
Dec 24th, 2021
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.74 KB | None | 0 0
  1. local features = {0x84D6, 0x3303, 0x2FF9, 0x4AD1, 0xC04F, 0xB6CE, 0x2844, 0xED30, 0x6A0B, 0xABCF, 0x358D, 0x8D0A, 0xEBAE,
  2.             0x1DF6, 0x3C0F, 0xC3B2, 0xE323, 0x8B2B, 0x1B6B, 0xEE44, 0xD266, 0xA54E, 0xDDFB, 0x6E7F, 0x3471, 0x03F5,
  3.             0x34B1, 0xF156, 0x561E, 0xF065, 0xAA69, 0x7AC3, 0x410D, 0x1A00, 0x91C1, 0xC375, 0xBB4D, 0xB0B0, 0x5D16}
  4.  
  5. BODY_TYPES = {-1241887289, 61606861, -369348190, -20262001, 32611963}
  6. WAIST_TYPES = {-2045421226, -1745814259, -325933489, -1065791927, -844699484, -1273449080, 927185840, 149872391,
  7.                399015098, -644349862, 1745919061, 1004225511, 1278600348, 502499352, -2093198664, -1837436619,
  8.                1736416063, 2040610690, -1173634986, -867801909, 1960266524}
  9.  
  10. math.randomseed(GetGameTimer())
  11.  
  12. function SetPlayerPedSkin(ped , setped)
  13.     if IsPedAPlayer(ped) and setped == "true" then
  14.         SetPlayerPed("mp_female")
  15.         ped = PlayerPedId()
  16.     end
  17.     FixPedIssues(ped)
  18.     print(1)
  19.     LoadBoody(ped)
  20.     print(2)
  21.     SetPedFaceFeature(ped)
  22.     print(3)
  23.     LoadBodySize(ped)
  24.     print(4)
  25.     LoadBodyWaist(ped)
  26.     print(5)
  27. end
  28.  
  29. function LoadBoody(ped)
  30.     NativeSetPedComponentEnabled(ped, tonumber(0x928DAD43), false, true, true)
  31.     NativeSetPedComponentEnabled(ped, tonumber(0xF0CD92EC), false, true, true)
  32.     NativeSetPedComponentEnabled(ped, tonumber(0x9D251F06), false, true, true)
  33. end
  34.  
  35. function FixPedIssues(ped)
  36.     Citizen.InvokeNative(0xD710A5007C2AC539, ped, 0x3F1F01E5, 0)
  37.     Citizen.InvokeNative(0xD710A5007C2AC539, ped, 0xDA0E2C55, 0)
  38.     NativeUpdatePedVariation(ped)
  39. end
  40.  
  41. function SetPedFaceFeature(ped)
  42.     for index, v in pairs(features) do
  43.         local floatValue = tonumber(math.random(-100, 100) / 100)
  44.         Citizen.InvokeNative(0x5653AB26C82938CF, ped, tonumber(v), floatValue)
  45.     end
  46.     NativeUpdatePedVariation(ped)
  47. end
  48.  
  49. function LoadBodyWaist(ped)
  50.     Citizen.InvokeNative(0x1902C4CFCC5BE57C, ped, WAIST_TYPES[math.random(1, #WAIST_TYPES)])
  51.     NativeUpdatePedVariation(ped)
  52. end
  53.  
  54. function LoadBodySize(ped)
  55.     Citizen.InvokeNative(0x1902C4CFCC5BE57C, ped, BODY_TYPES[math.random(1, #BODY_TYPES)])
  56.     NativeUpdatePedVariation(ped)
  57. end
  58.  
  59. function NativeUpdatePedVariation(ped)
  60.     Citizen.InvokeNative(0x704C908E9C405136, ped)
  61.     Citizen.InvokeNative(0xCC8CA3E88256E58F, ped, false, true, true, true, false)
  62.     while not NativeHasPedComponentLoaded(ped) do
  63.         Wait(1)
  64.     end
  65. end
  66.  
  67. function SetPlayerPed(model)
  68.     local modelHash = GetHashKey(model)
  69.     if IsModelValid(modelHash) then
  70.         if not HasModelLoaded(modelHash) then
  71.             RequestModel(modelHash)
  72.             while not HasModelLoaded(modelHash) do
  73.                 Wait(10)
  74.             end
  75.         end
  76.     end
  77.  
  78.     SetPlayerModel(PlayerId(), modelHash, false)
  79.     -- Citizen.InvokeNative(0x77FF8D35EEC6BBC4, PlayerPedId(), 0, 0)
  80.     NativeSetRandomOutfitVariation(PlayerPedId())
  81.     SetModelAsNoLongerNeeded(model)
  82. end
  83.  
  84. function NativeSetRandomOutfitVariation(ped)
  85.     Citizen.InvokeNative(0x283978A15512B2FE, ped, true)
  86. end
  87.  
  88. function NativeHasPedComponentLoaded(ped)
  89.     return Citizen.InvokeNative(0xA0BC8FAED8CFEB3C, ped)
  90. end
  91.  
  92. function NativeGetPedComponentCategory(isFemale, componentHash)
  93.     return Citizen.InvokeNative(0x5FF9A878C3D115B8, componentHash, isFemale, true)
  94. end
  95.  
  96. function NativeSetPedComponentEnabled(ped, componentHash, immediately, isMp)
  97.     local categoryHash = NativeGetPedComponentCategory(not IsPedMale(ped), componentHash)
  98.     Citizen.InvokeNative(0x59BD177A1A48600A, ped, categoryHash)
  99.     Citizen.InvokeNative(0xD3A7B003ED343FD9, ped, componentHash, immediately, isMp, true)
  100.     NativeUpdatePedVariation(ped)
  101. end
  102.  
  103. RegisterCommand("fixme", function(source, args)
  104.     SetPlayerPedSkin(PlayerPedId() , args[1])
  105. end)
  106.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement