Ищу сервер тайм

undewate

Известный
Автор темы
168
7
Версия SA-MP
  1. 0.3.7 (R1)
  2. 0.3.7-R2
  3. 0.3.7-R3
  4. 0.3.7-R4
  5. 0.3DL
  6. 0.3e (R1) / CR-MP
  7. CR-MP 0.3.7
  8. Любая
  9. Другая
Привет,
Ищу сервер тайм, где будут показаны еще и сотые секунды.
Если это ребилд таймер калаша вообщ бомба
 

krim

Известный
304
132
Lua:
local ffi = require 'ffi'

local font = renderCreateFont('arial', 12, 5)


function main()
    repeat wait(0) until isSampAvailable()
    while true do wait(0)
        local time = localTime()
        renderFontDrawText(font, time.wHour .. ':'.. time.wMinute .. ':' .. time.wSecond .. ':' .. time.wMilliseconds, 10,500, -1)
    end
end

function localTime()
    local time = ffi.new("SYSTEMTIME")
    ffi.C.GetLocalTime(time)
    return time
end

ffi.cdef[[
    typedef unsigned short WORD;

    typedef struct _SYSTEMTIME {
        WORD wYear;
        WORD wMonth;
        WORD wDayOfWeek;
        WORD wDay;
        WORD wHour;
        WORD wMinute;
        WORD wSecond;
        WORD wMilliseconds;
    } SYSTEMTIME, *PSYSTEMTIME;

    void GetSystemTime(
        PSYSTEMTIME lpSystemTime
    );

    void GetLocalTime(
        PSYSTEMTIME lpSystemTime
    );
]]
если я все правильно понял
 

undewate

Известный
Автор темы
168
7
Lua:
local ffi = require 'ffi'

local font = renderCreateFont('arial', 12, 5)


function main()
    repeat wait(0) until isSampAvailable()
    while true do wait(0)
        local time = localTime()
        renderFontDrawText(font, time.wHour .. ':'.. time.wMinute .. ':' .. time.wSecond .. ':' .. time.wMilliseconds, 10,500, -1)
    end
end

function localTime()
    local time = ffi.new("SYSTEMTIME")
    ffi.C.GetLocalTime(time)
    return time
end

ffi.cdef[[
    typedef unsigned short WORD;

    typedef struct _SYSTEMTIME {
        WORD wYear;
        WORD wMonth;
        WORD wDayOfWeek;
        WORD wDay;
        WORD wHour;
        WORD wMinute;
        WORD wSecond;
        WORD wMilliseconds;
    } SYSTEMTIME, *PSYSTEMTIME;

    void GetSystemTime(
        PSYSTEMTIME lpSystemTime
    );

    void GetLocalTime(
        PSYSTEMTIME lpSystemTime
    );
]]
если я все правильно понял
как переместить время то
 

krim

Известный
304
132

Вложения

  • Screenshot_2.png
    Screenshot_2.png
    1.9 KB · Просмотры: 86

krim

Известный
304
132
Lua:
local ffi = require 'ffi'

local font = renderCreateFont('arial', 12, 5)


function main()
    repeat wait(0) until isSampAvailable()
        sampRegisterChatCommand('tt', function() bool = not bool sampAddChatMessage(bool and 'Active' or 'Deactive', -1) end)
    while true do wait(0)
            if bool then
        local time = localTime()
        renderFontDrawText(font, time.wHour .. ':'.. time.wMinute .. ':' .. time.wSecond .. ':' .. time.wMilliseconds, 10,500, -1)
            end
    end
end

function localTime()
    local time = ffi.new("SYSTEMTIME")
    ffi.C.GetLocalTime(time)
    return time
end

ffi.cdef[[
    typedef unsigned short WORD;

    typedef struct _SYSTEMTIME {
        WORD wYear;
        WORD wMonth;
        WORD wDayOfWeek;
        WORD wDay;
        WORD wHour;
        WORD wMinute;
        WORD wSecond;
        WORD wMilliseconds;
    } SYSTEMTIME, *PSYSTEMTIME;

    void GetSystemTime(
        PSYSTEMTIME lpSystemTime
    );

    void GetLocalTime(
        PSYSTEMTIME lpSystemTime
    );
]]

Активация - /tt