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
);
]]
как переместить время тоесли я все правильно понял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 ); ]]
10,500как переместить время то
кк, а как стиль поменять чтобы выделение жирнее на 1 px было?10,500
кк, а как стиль поменять чтобы выделение жирнее на 1 px было?
local font = renderCreateFont('arial', 12, флаги меняй) -- здесь
скрипт автоматический. Активация нужна?thx i love you))
а еще можешь скинуть строчки чтобы при запуске сообщение выводилось, что бы понять работает или нет скрипт
желательно
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желательно