- 62
- 12
дернул формулу с клео пинг поинта, но бокс рисует в жопе
CLEO:
:PingPoint_419
6@, 7@, 8@ = get_char_coordinates 2@
9@ = samp_get_player_ping 1@
11@ = samp_get_player_id $scplayer
10@ = samp_get_player_ping 11@
add_int_lvar_to_int_lvar 9@ += 10@
cset_lvar_float_to_lvar_int 10@ =# 9@
print_formatted_now "%d: %d" {time} 100 {args} 1@ 9@
12@ = 17.0
12@ /= 360.0
mult_float_lvar_by_float_lvar 3@ *= 12@
mult_float_lvar_by_float_lvar 4@ *= 12@
mult_float_lvar_by_float_lvar 5@ *= 12@
mult_float_lvar_by_float_lvar 3@ *= 10@
mult_float_lvar_by_float_lvar 4@ *= 10@
mult_float_lvar_by_float_lvar 5@ *= 10@
add_float_lvar_to_float_lvar 6@ += 3@
add_float_lvar_to_float_lvar 7@ += 4@
add_float_lvar_to_float_lvar 8@ += 5@
cleo_call @PingPoint_694 {numArgs} 3 {args} 6@ 7@ 8@ 6@ 7@
draw_rect 6@ {y} 7@ {width} 10.0 {height} 10.0 {r} 0 {g} 50 {b} 155 {a} 200
draw_rect 6@ {y} 7@ {width} 3.0 {height} 3.0 {r} 255 {g} 0 {b} 0 {a} 200
Lua:
local imgui = require("mimgui")
local frame = imgui.OnFrame(
function() return true end,
function(player)
player.HideCursor = true
local dl = imgui.GetBackgroundDrawList()
for i, v in ipairs(getAllChars()) do
if doesCharExist(v) and isCharOnScreen(v) then
local playerId = select(2, sampGetPlayerIdByCharHandle(v))
local playerPedId = select(2, sampGetPlayerIdByCharHandle(PLAYER_PED))
local pX, pY, pZ = getCharCoordinates(v)
local sX, sY, sZ = 0, 0, 0
if isCharInAnyCar(v) then
sX, sY, sZ = getCarSpeedVector(storeCarCharIsInNoSave(v))
else
sX, sY, sZ = getCharVelocity(v)
end
local ping = sampGetPlayerPing(playerId) + sampGetPlayerPing(playerPedId)
local mult = 17.0 / 360.0
pX = pX + sX * mult * ping
pY = pY + sY * mult * ping
pZ = pZ + sZ * mult * ping
local x, y = convert3DCoordsToScreen(pX, pY, pZ)
dl:AddRectFilled(imgui.ImVec2(x - 10, y - 10), imgui.ImVec2(x + 10, y + 10), 0xC89B3200)
dl:AddRectFilled(imgui.ImVec2(x - 3, y - 3), imgui.ImVec2(x + 3, y + 3), 0xC80000FF)
end
end
end
)