Вопрос Fast Wanted-Warant

  • 11
  • 0
Контакты для связи отсутствуют.
Всем привет. Есть код, что бы быстро давать ордер/розыск если смотреть на людей или двери людей. Кто может помочь сделать так, что бы можно было давать розыск/ордер на пропы?

Вот сам код


Lua:
concommand.Add("autowarrant",function()
    local ent = LocalPlayer():GetEyeTrace().Entity
    if ent and ent:GetClass()=="prop_door_rotating" then
        if ent.getDoorOwner then
            local darkrp = ent:getDoorOwner()
            if darkrp then
                LocalPlayer():ConCommand("say /warrant "..darkrp:SteamID().." Нелегал")
            end
            return
        end
        if ent.DoorGetOwner then
            local darkrp = ent:DoorGetOwner()
            if darkrp then
                LocalPlayer():ConCommand("say /warrant "..darkrp:SteamID().." Нелегал")
            end
            return
        end
    elseif ent and ent:GetClass()=="player" then
        LocalPlayer():ConCommand("say /wanted "..ent:SteamID().." Нелегал")
    end
end)

А вот я пытался сделать сам, но выбивало ошибку или не работало в принципе


Lua:
    elseif ent and ent:GetClass()=="props_physics" then
        LocalPlayer():ConCommand("say /wanted "..ent:SteamID().." Нелегал")
    end

Но код не работал и просто выбивало ошибку связанную с стимайди
 
  • 442
  • 8
  • 102
Попробуй
Lua:
concommand.Add("autowarrant", function()
    local ent = LocalPlayer():GetEyeTrace().Entity
    if ent and ent:GetClass() == "prop_door_rotating" then
        if ent.getDoorOwner then
            local darkrp = ent:getDoorOwner()
            if darkrp then
                LocalPlayer():ConCommand("say /warrant " .. darkrp:SteamID() .. " Нелегал")
            end
            return
        end
        if ent.DoorGetOwner then
            local darkrp = ent:DoorGetOwner()
            if darkrp then
                LocalPlayer():ConCommand("say /warrant " .. darkrp:SteamID() .. " Нелегал")
            end
            return
        end
    elseif ent and ent:GetClass() == "player" then
        LocalPlayer():ConCommand("say /wanted " .. ent:SteamID() .. " Нелегал")
    end
 
Активность
Пока что здесь никого нет
Сверху Снизу