Текстуры Enhanced 3D [1.19.2]

Ну и еще один ресурспак, в котором заменено много 3д моделей для бога 3д моделей - тут и обычные блоки заменены по типу дерева, камня, лавы, так и обычные вещи по типу подзорной трубы тоже имеют новые 3д модели, и прич ем довольно качественные, что удачно вписываются в дефолтный мир игры.


1666883036558.png


1666883127741.png

Карта Safari Maze [1.19.2]

Safari Maze — это карта головоломка, где вам придётся найти выход из лабиринта. Появитесь вы в своём доме, в одной из комнат которого найдёте головоломку с рычагами. Отыскав их в глубинах лабиринта, вам нужно будет вернуться к своему дому и решить финальную головоломку, дабы закончить прохождение карты.

1666882855709.png

Карта Лабиринт Хранителя [1.19.2]

На этой карте вы попадаете в лабиринт, в котором спрятаны сундуки с кнопками, которые необходимо найти, а затем найти блоки, на которые можно поставить кнопки. Но за вами будут гнаться Хранители (Варден). Цель карты - выбраться из лабиринта, умерев как можно меньше раз. На карте можно играть как одному, так и с друзьями.

1666882183673.png


1666882190235.png

Карта Bunker Ahill [1.19.2]

Бункер "Ахилл" - подземный комплекс для элитарного класса общества. Имеет множество этажей, зон для досуга и различных занятий. Здесь вы обязательно найдёте чем занять себя! Приятного отдыха!

1666882015243.png


1666882024877.png


1666882037579.png

Карта Poppy Playtime [1.19.2]

Данная карта создана по мотивам игры "Poppy Playtime", в которой все продумано до мелочей. Ваша задача - сбежать из фабрики игрушек, но не все так просто, ведб за вами наблюдает Хагги вагги. Карта рассчитана на одиночное прохождение.

1666881885261.png

Карта Dance Monkey [1.19.2]

Данная карта - это паркур, который сделан в новом стиле. Нужно прыгать по блокам в бит популярной песни Tones and I - Dance Monkey. Пишите название своей любимой песни в комментариях и может быть, автор сделает по ней такую же карту.

1666881519931.png


1666881530844.png

Library [TenserFlow] [Keras] Image Classificator

C#:
Развернуть Свернуть Копировать
Detector detector = new Detector("name", "model.savedmodel", "labels.txt", 7999, false);
detector.StartDetector();

var result = detector.Detect("1.png");
if (result.Success)
{
    Console.WriteLine("File: " + result.File);
    Console.WriteLine("Class id: " + result.result.Id);
    Console.WriteLine("Class Name: " + result.result.Name);
    Console.WriteLine("Class Confidence: " + result.result.Confidence);
}
else
{
    Console.WriteLine("Client not loaded");
}

1. Заходим на Teachable Machine
1.1.Нажимаем начать
2. Выбираем проект с изображениями (Стандартная модель)
3. Загружаем и класифицируем изображения
4. Обучаем модель
5. Нажимаем экспортировать модель
5.1 Выбираем TenserFlow
5.2 Выбираем Savedmodel
5.3 Скачиваем модель

Python:
Развернуть Свернуть Копировать
import sys
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensorflow as tf
tf.get_logger().setLevel('ERROR')
from tensorflow import keras
from keras.models import load_model
from PIL import Image, ImageOps
import numpy as np

import socket
   
import socketserver

class MyTCPHandler(socketserver.BaseRequestHandler):
    def handle(self):
        # self.request is the TCP socket connected to the client
        self.data = self.request.recv(1024).strip()
       
        image_path = self.data.strip()
        image = Image.open(image_path).convert('RGB')
        size = (224, 224)
        image = ImageOps.fit(image, size)
        image_array = np.asarray(image)
        # Normalize the image
        normalized_image_array = (image_array.astype(np.float32) / 127.0) - 1
        # Load the image into the array
        data[0] = normalized_image_array
        # run the inference
        prediction = model.predict(data)
        index = np.argmax(prediction)
        class_name = class_names[index]
        confidence_score = prediction[0][index]
        print('Image: ', image_path)
        print('Class: ', class_name, end='')
        print('Confidence Score: ', confidence_score)
       
        senddata = "Image: " + str(image_path) + "\nClass: " + str(class_name) + "Confidence Score: " + str(confidence_score);
       
        self.request.sendall(bytes(senddata, "utf-8"))

if __name__ == "__main__":
    HOST, PORT = "localhost", int(sys.argv[3])
   
    np.set_printoptions(suppress=False)
    print("Loading model...")
    model = load_model(sys.argv[1], compile=False)
    print("Model loaded")
    print("Loading class names...")
    class_names = open(sys.argv[2], 'r').readlines()
    print("Class names loaded")
    data = np.ndarray(shape=(1, 224, 224, 3), dtype=np.float32)
    print("Starting server...")
    with socketserver.TCPServer((HOST, PORT), MyTCPHandler) as server:
        print("Server started")
        server.serve_forever()

LUA 🌍 Никнейм худ

Lua:
Развернуть Свернуть Копировать
local white = Color (255,255,255)
local plyMeta = FindMetaTable("Player")
    
plyMeta.drawPlayerInfo = function(self)
    if not IsValid(self) then return end
    local pos = self:EyePos()   
    if(self:GetPos():Distance(LocalPlayer():GetPos()) <= 150) then   
      pos.z = pos.z + 1
      pos = pos:ToScreen()
      if GAMEMODE.Config.showname then
        local nick = self:Nick()
        draw.SimpleText(string.upper(nick),"Trebuchet24",pos.x + 80, pos.y + 1,white,TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER)
      end
    end
end

LUA ♿ Вайтлист

:8101_lua_logo:
Обновлённая версия вайтлиста для допуска на сервер. Теперь он срабатывает сразу при попытке присоединиться на сервер.

Lua:
Развернуть Свернуть Копировать
local steamid_whitelist = {
    ["STEAM_0:0:155531789"] = true, -- Здесь вставляйте SteamID. Для внесения новых SteamID просто скопируйте и вставьте строку
}

hook.Add("CheckPassword","Server_Whitelist",function(steamid)
    local ssteamid = util.SteamIDFrom64(steamid)
    if !steamid_whitelist[ssteamid] then
        return false, "Вы не в вайтлисте сервера!"
    end
end)

LUA 🍩 Spinning Donut 3D | LUA

Решил дропнуть для вас код, который создаёт анимированный 3D пончик в консоли

Демонстрация:
YouTube 8MKw9EApG2c

Оригинальный код: spinning-donuts/donut.lua at master · Zeyu-Li/spinning-donuts (Наш код адаптирован под консоль гмода)

Код ниже

Lua:
Развернуть Свернуть Копировать
Theta_spacing = 0.07
Phi_spacing = 0.02

local a, ba, Main_str, z, b
a = 0
ba = 0

Main_str = {'.',',','-','~',':',';','=','!','*','#','$','@'}



z = {}
b = {}


hook.Add("Think","1245",function()
    local i,j
    j=0
    for l=1, 1760 do
        z[l] = 0
    end
    for t=1, 1760 do
        b[t] = ' '
    end
    while j < 6.28 do
        j=j+Theta_spacing
        i=0
        while i < 6.28 do
            i=i+Phi_spacing

            local c,d,e,f,g,h,D,l,m,n,t,x,y,o,N
            c = math.sin(i)
            l = math.cos(i)
            d = math.cos(j)
            f = math.sin(j)

            e = math.sin(a)
            g = math.cos(a)
            h = d + 2
            D = 1 / (c * h * e + f * g + 5)

            m = math.cos(ba)
            n = math.sin(ba)
            t = c * h * g - f * e

            x = math.floor(40 + 30 * D * (l * h * m - t * n))
            y = math.floor(12 + 15 * D * (l * h * n + t * m))
            o = math.floor(x + (80 * y))
            N = math.floor(8 * ((f * e - c * d * g) * m - c * d * e - f * g - l * d * n))

            if 22>y and y>0 and 80>x and x>0 and D>z[o+1] then
                z[o+1] = D
                if N>0 then
                    b[o+1] = Main_str[N+1]
                else
                    b[o+1] = '.'
                end
            end
        end
    end


    for l=1,1760 do
        if l%80 ~= 0 then
            Msg(tostring(b[l]))
        else
            print()
        end
    end
    
    a=a+0.04
    ba=ba+0.02
end)

LUA ⭐ Получить свою позицию PLY

Очень полезно для тех, кто настраивает там какие-то дерьмовые конфиги

Консольные команды ply_getpos и ply_getang на получение своей позиции и угла в формате Vector(x,y,z) и Angle(p,y,r). После того, как вы напишите команду, информация сразу скопируется в буфер обмена.


Lua:
Развернуть Свернуть Копировать
concommand.Add("ply_getpos",function(ply,cmd,args)
    local pos = ply:GetPos()
    local vec = "Vector("..math.Round(pos.x)..","..math.Round(pos.y)..","..math.Round(pos.z)..")"
    print("Copied to clipboard!\n"..vec)
    SetClipboardText(vec)
end)

concommand.Add("ply_getang",function(ply,cmd,args)
    local pos = ply:EyeAngles()
    local vec = "Angle("..math.Round(pos.p)..","..math.Round(pos.y)..","..math.Round(pos.r)..")"
    print("Copied to clipboard!\n"..vec)
    SetClipboardText(vec)
end)

LUA 🌿 Фикс Itemstore дюп

Код:
Развернуть Свернуть Копировать
ITEMSTORE_TIMEOUT = 0.25

local meta = FindMetaTable( "Player" )

function meta:SetupInventory()
    local usergroup = self:GetUserGroup()

    if serverguard then
        -- suck my dick serverguard, why don't you use gmod's default rank stuff
        usergroup = serverguard.player:GetRank( self )
    end

    local inv_size = itemstore.config.InventorySizes[ usergroup ]

    if not inv_size then
        inv_size = itemstore.config.InventorySizes[ "default" ]
    end

    self.Inventory = itemstore.Container( unpack( inv_size ) )
    self.Inventory:SetOwner( self )
    self.Inventory:SetPermissions( self, true, true )

    self.Inventory:AddCallback( "set", function()
        self.QueueItemStoreSave = true
    end )

    self.Inventory:AddCallback( "read", function( this, pl )
        local owner = self.Inventory:GetOwner()
        local wep = pl:GetActiveWeapon()
        local dist = owner:GetPos():Distance( pl:GetPos() )

        if IsValid( wep ) and wep:GetClass() == "itemstore_checker" and dist < 250 then
            return true
        end
    end )

    local bank_size = itemstore.config.BankSizes[ usergroup ]

    if not bank_size then
        bank_size = itemstore.config.BankSizes[ "default" ]
    end

    self.Bank = itemstore.Container( unpack( bank_size ) )
    self.Bank:SetOwner( self )
    self.Bank:AddCallback( "set", function()
        self.QueueItemStoreSave = true
    end )

    local function callback( con, pl )
        for _, ent in ipairs( ents.FindByClass( "itemstore_bank" ) ) do
            if ent:GetPos():Distance( pl:EyePos() ) < 256 then
                return true
            end
        end

        return false
    end

    self.Bank:AddCallback( "read", callback )
    self.Bank:AddCallback( "write", callback )

    itemstore.data.Load( self )

    hook.Run( "ItemStoreInventoryCreated", self, self.Inventory, self.Bank )

    if itemstore.config.MigrateOldData then
        local path = "itemstore/" .. self:UniqueID() .. ".txt"

        if file.Exists( path, "DATA" ) then
            local inv = util.JSONToTable( file.Read( path, "DATA" ) )

            if inv then
                for k, v in ipairs( inv ) do
                    self.Inventory:SetItem( k, itemstore.Item( v.UniqueName, v.Data ) )
                end

                file.Delete( path, "DATA" )
            end
        end

        local path = "itemstore/banks/" .. self:UniqueID() .. ".txt"

        if file.Exists( path, "DATA" ) then
            local inv = util.JSONToTable( file.Read( path, "DATA" ) )

            if inv then
                for k, v in ipairs( inv ) do
                    self.Bank:SetItem( k, itemstore.Item( v.UniqueName, v.Data ) )
                end

                file.Delete( path, "DATA" )
            end
        end
    end

    return self.Inventory, self.Bank
end

function meta:PickupItem( ent )
    ent = ent or util.QuickTrace( self:GetShootPos(),
        self:GetAimVector() * itemstore.config.PickupDistance, self ).Entity

    if not IsValid( ent ) or ent.__Deleted or not itemstore.items.Pickups[ ent:GetClass() ] then
        return false end

    local class = itemstore.items.Pickups[ ent:GetClass() ]
    if itemstore.config.DisabledItems[ class ] then return false end
  
    local item = itemstore.Item( class )
    if not item then return end
  
    item:SaveData( ent )

    local con = itemstore.config.PickupsGotoBank and self.Bank or self.Inventory

    if not con:CanFit( item ) then return false end
    if hook.Call( "ItemStoreCanPickup", GAMEMODE, self, item, ent ) == false then return false end
    if not item:CanPickup( self, ent ) then return false end

    local slot = con:AddItem( item )

    if slot then
        item:Pickup( self, con, slot, ent )
        ent:Remove()

        --self:ChatPrint( itemstore.Translate( "picked_up", item:GetName() ) )
        self:EmitSound( "items/gunpickup2.wav" )

        return true
    end

    self.QueueItemStoreSave = true
end

function meta:MoveItem( from_con_id, from_slot, to_con_id, to_slot )
    local from_con = itemstore.containers.Get( from_con_id )
    local to_con = itemstore.containers.Get( to_con_id )

    if not from_con or not to_con then return end

    local from_item = from_con:GetItem( from_slot )
    local to_item = to_con:GetItem( to_slot )
    if not from_item and not to_item then return end

    if from_con:CanWrite( self, "move", to_con, to_slot, to_item, from_slot, from_item ) ~= false and
        to_con:CanWrite( self, "move", from_con, from_slot, from_item, to_slot, to_item ) ~= false then


        from_con:SetSuppressed( true )
        to_con:SetSuppressed( true )

        from_con:SetItem( from_slot, to_item )
        to_con:SetItem( to_slot, from_item )

        from_con:SetSuppressed( false )
        to_con:SetSuppressed( false )

        from_con:QueueSync()
        if from_con ~= to_con then
            to_con:QueueSync()
        end
    end
end

util.AddNetworkString( "ItemStoreMove" )
net.Receive( "ItemStoreMove", function( len, pl )
    local from_con_id = net.ReadUInt( 32 )
    local from_slot = net.ReadUInt( 32 )
    local to_con_id = net.ReadUInt( 32 )
    local to_slot = net.ReadUInt( 32 )

    pl:MoveItem( from_con_id, from_slot, to_con_id, to_slot )
end )

function meta:UseItem( con_id, slot)
    local con = itemstore.containers.Get( con_id )
    if not con then return end

    local item = con:GetItem( slot )

    if not item or not item.Use then return end
    if con:CanWrite( self, "use", slot, item ) == false then return end

    /*if item:Use( self, con, slot, ... ) then
        con:SetItem( slot, nil )
    end*/
    if item:Use( self, con, slot) then
        con:SetItem( slot, nil )
    end

    con:QueueSync()
    self.QueueItemStoreSave = true
end

util.AddNetworkString( "ItemStoreUse" )
net.Receive( "ItemStoreUse", function( len, pl )
    local con_id = net.ReadUInt( 32 )
    local slot = net.ReadUInt( 32 )
    //local args = net.ReadTable()

    //pl:UseItem( con_id, slot, unpack( args ) )
    pl:UseItem( con_id, slot)
end )

function meta:UseItemWith( from_con_id, from_slot, to_con_id, to_slot )
    local from_con = itemstore.containers.Get( from_con_id )
    local to_con = itemstore.containers.Get( to_con_id )
  
    if not from_con or not to_con then return end

    local from_item = from_con:GetItem( from_slot )
    local to_item = to_con:GetItem( to_slot )
    if not from_item or not not to_item or from_item == to_item then return end

    if not from_item.UseWith or not from_item:CanUseWith( to_item ) then return end

    if from_con:CanWrite( self, "usewith", from_slot, from_item, to_con,
        to_slot, to_item ) == false then return end

    from_con:SetSuppressed( true )
    to_con:SetSuppressed( true )
  
    if from_item:UseWith( self, to_item, from_con, from_slot, to_con, to_slot ) then
        from_con:SetItem( from_slot, nil )
    end

    from_con:SetSuppressed( false )
    to_con:SetSuppressed( false )

    from_con:QueueSync()
    if from_con ~= to_con then to_con:QueueSync() end
end

util.AddNetworkString( "ItemStoreUseWith" )
net.Receive( "ItemStoreUseWith", function( len, pl )
    local from_con_id = net.ReadUInt( 32 )
    local from_slot = net.ReadUInt( 32 )
    local to_con_id = net.ReadUInt( 32 )
    local to_slot = net.ReadUInt( 32 )

    pl:UseItemWith( from_con_id, from_slot, to_con_id, to_slot )
end )

function meta:DropItem( con_id, slot )
    local con = itemstore.containers.Get( con_id )
    if not con then return end

    local item = con:GetItem( slot )
    if not item then return end

    if con:CanWrite( self, "drop", slot, item ) == false then return end

    local pos = util.QuickTrace( self:GetShootPos(),
        self:GetAimVector() * itemstore.config.DropDistance, self ).HitPos
    local ent = item:CreateEntity( pos )
    item:Drop( self, con, slot, ent )

    if CPPI then
        ent:CPPISetOwner( self )
    end

    if item.DropStack or item:TakeOne() then
        con:SetItem( slot, nil )
    end

    con:QueueSync()
    self.QueueItemStoreSave = true

    self:EmitSound( "items/ammocrate_open.wav" )
end

util.AddNetworkString( "ItemStoreDrop" )
net.Receive( "ItemStoreDrop", function( len, pl )
    local con_id = net.ReadUInt( 32 )
    local slot = net.ReadUInt( 32 )

    pl:DropItem( con_id, slot )
end )

function meta:DestroyItem( con_id, slot )
    local con = itemstore.containers.Get( con_id )
    if not con then return end

    local item = con:GetItem( slot )
    if not item then return end

    if item and con:CanWrite( self, "destroy", slot, item ) ~= false then
        item:Destroy( self, con, slot )     
        con:SetItem( slot, nil )     

        self:EmitSound( "physics/concrete/concrete_break2.wav" )
    end
end

util.AddNetworkString( "ItemStoreDestroy" )
net.Receive( "ItemStoreDestroy", function( len, pl )
    local con_id = net.ReadUInt( 32 )
    local slot = net.ReadUInt( 32 )

    pl:DestroyItem( con_id, slot )
end )

function meta:MergeItem( from_con_id, from_slot, to_con_id, to_slot )
    local from_con = itemstore.containers.Get( from_con_id )
    local to_con = itemstore.containers.Get( to_con_id )
    local from_item = from_con:GetItem( from_slot )
    local to_item = to_con:GetItem( to_slot )

    if from_item and to_item and not ( from_con == to_con and from_slot == to_slot ) and
        from_con:CanWrite( self, "merge", to_con_id, from_slot, from_item, to_slot, to_item ) ~= false and
        to_con:CanWrite( self, "merge", from_con_id, from_slot, from_item, to_slot, to_item ) ~= false and
        to_item:CanMerge( from_item ) then

        from_con:SetSuppressed( true )
        to_con:SetSuppressed( true )

        to_item:Merge( from_item )
        from_con:SetItem( from_slot, nil )

        from_con:SetSuppressed( false )
        to_con:SetSuppressed( false )

        from_con:QueueSync()
        if from_con ~= to_con then to_con:QueueSync() end
    end
end

util.AddNetworkString( "ItemStoreMerge" )
net.Receive( "ItemStoreMerge", function( len, pl )
    local from_con_id = net.ReadUInt( 32 )
    local from_slot = net.ReadUInt( 32 )
    local to_con_id = net.ReadUInt( 32 )
    local to_slot = net.ReadUInt( 32 )

    pl:MergeItem( from_con_id, from_slot, to_con_id, to_slot )
end )

function meta:SplitItem( con_id, slot, amount )
    local con = itemstore.containers.Get( con_id )
    local item = con:GetItem( slot )

    if con:FirstEmptySlot() and item and item:CanSplit( amount ) and
        con:CanWrite( self, "split", slot, item, amount ) ~= false then

        con:AddItem( item:Split( amount ), true )
    end
end

util.AddNetworkString( "ItemStoreSplit" )
net.Receive( "ItemStoreSplit", function( len, pl )
    if pl.ItemStoreTimeout and pl.ItemStoreTimeout > CurTime() then return end
    pl.ItemStoreTimeout = CurTime() + ITEMSTORE_TIMEOUT
    local con_id = net.ReadUInt( 32 )
    local slot = net.ReadUInt( 32 )
    local amount = net.ReadUInt( 16 )
    if amount == 0 then return end
    pl:SplitItem( con_id, slot, amount )
end )

util.AddNetworkString( "ItemStoreOpen" )
function meta:OpenContainer( id, name, hideinv )
    net.Start( "ItemStoreOpen" )
        net.WriteUInt( id, 32 )
        net.WriteString( name )
        net.WriteBit( hideinv )
    net.Send( self )
end

util.AddNetworkString( "ItemStoreSyncInventory" )
net.Receive( "ItemStoreSyncInventory", function( len, pl )
    pl.Inventory:Sync()

    net.Start( "ItemStoreSyncInventory" )
        net.WriteUInt( pl.Inventory:GetID(), 32 )
    net.Send( pl )
end )

hook.Add( "PlayerInitialSpawn", "ItemStoreLoadInventory", function( pl )
    timer.Simple( 0, function()
        if IsValid( pl ) then pl:SetupInventory() end
    end )
end )

hook.Add( "PlayerUse", "ItemStorePickup", function( pl, ent )
    -- fuck you wiremod
    -- why would you EVER replace the player parameter with some random entity
    -- what is your fucking damage
    if not IsValid( pl ) or not pl:IsPlayer() then return end

    if ent.__Deleted then
        -- Anti-dupe, never let anything marked as deleted to be used
        return false
    end

    -- thanks brax
    if itemstore.config.PickupKey > -1 and pl:KeyDown( itemstore.config.PickupKey )
        and pl:PickupItem( ent ) then
      
        return false
    end
end )

hook.Add( "PlayerDeath", "ItemStoreDeathLoot", function( pl )
    if not itemstore.config.DeathLoot then return end
    if table.Count( pl.Inventory:GetItems() ) <= 0 then return end

    local ent = ents.Create( "itemstore_deathloot" )
    ent:SetPos( pl:GetPos() )
    ent:Spawn()

    ent.Container:SetWidth( pl.Inventory:GetWidth() )
    ent.Container:SetHeight( pl.Inventory:GetHeight() )
    ent.Container:SetPages( pl.Inventory:GetPages() )

    for k, v in pairs( pl.Inventory:GetItems() ) do
        ent.Container:SetItem( k, v )
        pl.Inventory:SetItem( k, nil )
    end

    ent.Timeout = CurTime() + itemstore.config.DeathLootTimeout
end )

Команда форума онлайн

Пользователи онлайн

Статистика форума

Темы
29,181
Сообщения
187,203
Пользователи
129,128
Новый пользователь
johnfff
Назад
Сверху Снизу