Исправить код как(WH на олений Radmir)

mectz

Новичок
Автор темы
1
0
Версия MoonLoader
.026-beta
Вот есть код для вх на олений к ним идут трейсеры , но после того как убил трейсер все равно есть , выключить включить не помогает трайсера останутся и так их будет до бесконечности, нужно сделать так чтобы после смерти оленя трейсер пропал, как это сделать?
Код:
local active = false
local font = renderCreateFont('ShellyAllegroC',6,5)
function main()
    repeat wait(0) until isSampAvailable()
 
  sampRegisterChatCommand('oleni', function()
    active = not active
    if active then
      sampAddChatMessage('{FFFF00}[WHT]{FFFFFF}: ' .. (status and 'Вкл' or 'Вкл'), -1)
    else
      sampAddChatMessage('{FFFF00}[WHT]{FFFFFF}: ' .. (status and 'Выкл' or 'Выкл'), -1)
    end
  end)
 
    while true do wait(0)
    if active then
      for _, value in ipairs(getAllChars()) do
        if value ~= PLAYER_PED and doesCharExist(value) then
          local modelid = getCharModel(value)
          if isCharOnScreen(value) then
            if modelid == 15555 or modelid == 15556 then
              local x,y,z = getCharCoordinates(playerPed)
              local posX,posY,posZ = getCharCoordinates(value)
              local X,Y = convert3DCoordsToScreen(x, y, z)
              local _X,_Y = convert3DCoordsToScreen(posX, posY, posZ)
              if modelid == 15555 then
                renderDrawLine(X,Y,_X,_Y,3,-1)
                renderFontDrawText(font,'{ff8c69}Olen',_X,_Y,-1)
              elseif modelid == 15556 then
                renderDrawLine(X,Y,_X,_Y,3,-1)
                renderFontDrawText(font,'{e9967a}Medvedi',_X,_Y,-1)
              end
            end
          end
        end
      end
    end
  end
end
 

qdIbp

Автор темы
Проверенный
1,444
1,187
Я не знаком с Радмиром, но попробуй вот так

Lua:
function main()
    repeat
        wait(0)
    until isSampAvailable()
    
    local font = renderCreateFont('ShellyAllegroC', 6, 5)
    sampRegisterChatCommand('oleni', function()
        active = not active
        sampAddChatMessage('{FFFF00}[WHT]{FFFFFF}: ' .. (active and 'Вкл' or 'Вкл'), -1)
    end)
 
    while (true) do
        wait(0)
        if (active) then
            for _, value in ipairs(getAllChars()) do
                if (value ~= PLAYER_PED and doesCharExist(value)) then
                    local modelid = getCharModel(value)
                    if (isCharOnScreen(value)) then
                        if (modelid == 15555 or modelid == 15556) then
                            local x, y, z = getCharCoordinates(playerPed)
                            local posX, posY, posZ = getCharCoordinates(value)
                            
                            local X, Y = convert3DCoordsToScreen(x, y, z)
                            local _X,_Y = convert3DCoordsToScreen(posX, posY, posZ)
                            
                            if ((modelid == 15555 or modelid == 15556) and getCharHealth(value) > 3) then
                                renderDrawLine(X, Y, _X, _Y, 3, -1)
                                renderFontDrawText(font,(modelid == 15555 and '{ff8c69}Olen' or '{e9967a}Medvedi'), _X, _Y, -1)
                            end
                        end
                    end
                end
            end
        end
    end
end