Вопрос attach_object

NeverStu

Известный
Автор темы
517
162
Версия MoonLoader
.026-beta
Как написать простой стиллер обьектов на игроке к примеру пишу stt id игрока и у меня в консоль Сампфункса Переноситься к примеру такое


Lua:
 attach_object(player_id(), 9, 2996, 2, Vector3D(0.079000003635883, 0.010900000110269, 0), Vector3D(-0.40000000596046, -5.5998997688293, 60.5), Vector3D(4.0759000778198, 3.9289000034332, 4.6859998703003), -256, 0)
    attach_object(player_id(), 8, 3100, 2, Vector3D(0.11200000345707, -0.019899999722838, 0.0038999998942018), Vector3D(-93.900001525879, -54.599899291992, -92.799896240234), Vector3D(4.5248999595642, 4.2319002151489, 3.1719000339508), 0, 0)
    attach_object(player_id(), 7, 2996, 2, Vector3D(0.14300000667572, 0.10989999771118, 0.075000002980232), Vector3D(25.199899673462, -5.5998997688293, -25.099899291992), Vector3D(1.8679000139236, 0.68900001049042, 2.0408999919891), -256, 0)
    attach_object(player_id(), 6, 2996, 2, Vector3D(0.15889999270439, 0.10490000247955, -0.062899999320507), Vector3D(-24.60000038147, -5.5998997688293, -33.099899291992), Vector3D(1.8679000139236, 0.68900001049042, 2.0408999919891), -256, 0)
    attach_object(player_id(), 5, 19063, 2, Vector3D(0.125, 0.061900001019239, 0.060899998992682), Vector3D(82.699897766113, -4.8000001907349, 7.3000001907349), Vector3D(0.15989999473095, 0.15889999270439, 0.17990000545979), 0, -16777216)
    attach_object(player_id(), 4, 19063, 2, Vector3D(0.14000000059605, 0.059900000691414, -0.046900000423193), Vector3D(82.699897766113, -4.8000001907349, 7.3000001907349), Vector3D(0.14990000426769, 0.14990000426769, 0.17990000545979), 0, -16777216)
    attach_object(player_id(), 3, 3100, 2, Vector3D(0.070900000631809, -0.0070000002160668, -0.16789999604225), Vector3D(-84.999900817871, 0, -140.29989624023), Vector3D(1.5788999795914, 6.4179000854492, 1.6068999767303), -65281, 0)
    attach_object(player_id(), 2, 2996, 2, Vector3D(0.066899999976158, 0.10800000280142, 0.0080000003799796), Vector3D(4.5998997688293, -6.5999999046326, -67.099899291992), Vector3D(1.7858999967575, 0.67900002002716, 2.6598999500275), -256, 0)
    attach_object(player_id(), 1, 3100, 2, Vector3D(0.044900000095367, 0.014899999834597, 0.15889999270439), Vector3D(-84.999900817871, 0, -51.199901580811), Vector3D(1.5788999795914, 6.4179000854492, 1.6068999767303), -65281, 0)
    attach_object(player_id(), 0, 3100, 2, Vector3D(0.20200000703335, -0.019899999722838, 0.0038999998942018), Vector3D(-156.69999694824, -52.899898529053, -83.199897766113), Vector3D(0.69989997148514, 0.833899974823, 1.9968999624252), 0, 0)
Будут вопросы задавайте отвечу если буду в сети
 

wojciech?

Известный
Проверенный
414
363
Lua:
local ffi = require("ffi")
local sampapi = require("sampapi")
local SCNetGame = sampapi.require("CNetGame", true)

function get_player_accs(id)
  local player = SCNetGame.RefNetGame():GetPlayerPool():GetPlayer(id)
  if player == ffi.NULL or player.m_pPed == ffi.NULL then
    return
  end
  return player.m_pPed.m_accessories
end

-- use
local accs = get_player_accs(0) -- вместо 0 ид любого игрока
if accs then
  for slot = 0, ffi.C.MAX_ACCESSORIES - 1 do
    if accs.m_bNotEmpty[slot] then
      -- в accs.m_info[slot] содержится:
      -- struct SAccessory {
      --  int m_nModel;
      --  int m_nBone;
      --  SCVector m_offset;
      --  SCVector m_rotation;
      --  SCVector m_scale;
      --  D3DCOLOR m_firstMaterialColor;
      --  D3DCOLOR m_secondMaterialColor;
      -- };
      -- можешь вывести всё это в любой удобный тебе формат
    end
  end
end
 
  • Влюблен
Реакции: NeverStu