- 6
- 1
как переделать чтобы трейсера работали на одного человека за котором ты находишься в реконе
kod:
local bulletSync = {lastId = 0, maxLines = elements.int.maxNotMyLines.v}
for i = 1, bulletSync.maxLines do
bulletSync[i] = {other = {time = 0, t = {x,y,z}, o = {x,y,z}, type = 0, color = 0}}
end
if elements.checkbox.bulletTracer.v then
for i = 1, bulletSync.maxLines do
if bulletSync[i].other.time >= oTime then
local result, wX, wY, wZ, wW, wH = convert3DCoordsToScreenEx(bulletSync[i].other.o.x, bulletSync[i].other.o.y, bulletSync[i].other.o.z, true, true)
local resulti, pX, pY, pZ, pW, pH = convert3DCoordsToScreenEx(bulletSync[i].other.t.x, bulletSync[i].other.t.y, bulletSync[i].other.t.z, true, true)
if result and resulti then
local xResolution = memory.getuint32(0x00C17044)
if wZ < 1 then
wX = xResolution - wX
end
if pZ < 1 then
pZ = xResolution - pZ
end
renderDrawLine(wX, wY, pX, pY, elements.int.widthRenderLineOne.v, bulletSync[i].other.color)
if elements.checkbox.cbEnd.v then
renderDrawPolygon(pX, pY-1, 3 + elements.int.sizeOffPolygonTwo.v, 3 + elements.int.sizeOffPolygonTwo.v, 1 + elements.int.polygonNumberTwo.v, elements.int.rotationPolygonTwo.v, bulletSync[i].other.color)
end
end
end
end
end
function samp.onBulletSync(playerid, data)
if elements.checkbox.bulletTracer.v then
if data.center.x ~= 0 then
if data.center.y ~= 0 then
if data.center.z ~= 0 then
bulletSync.lastId = bulletSync.lastId + 1
if bulletSync.lastId < 1 or bulletSync.lastId > bulletSync.maxLines then
bulletSync.lastId = 1
end
bulletSync[bulletSync.lastId].other.time = os.time() + elements.int.secondToClose.v
bulletSync[bulletSync.lastId].other.o.x, bulletSync[bulletSync.lastId].other.o.y, bulletSync[bulletSync.lastId].other.o.z = data.origin.x, data.origin.y, data.origin.z
bulletSync[bulletSync.lastId].other.t.x, bulletSync[bulletSync.lastId].other.t.y, bulletSync[bulletSync.lastId].other.t.z = data.target.x, data.target.y, data.target.z
if data.targetType == 0 then
bulletSync[bulletSync.lastId].other.color = join_argb(255, staticObject.v[1]*255, staticObject.v[2]*255, staticObject.v[3]*255)
elseif data.targetType == 1 then
bulletSync[bulletSync.lastId].other.color = join_argb(255, pedP.v[1]*255, pedP.v[2]*255, pedP.v[3]*255)
elseif data.targetType == 2 then
bulletSync[bulletSync.lastId].other.color = join_argb(255, carP.v[1]*255, carP.v[2]*255, carP.v[3]*255)
elseif data.targetType == 3 then
bulletSync[bulletSync.lastId].other.color = join_argb(255, dinamicObject.v[1]*255, dinamicObject.v[2]*255, dinamicObject.v[3]*255)
end
end
end
end
end
end