local encoding require encoding local key require vkeys local hook req

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
local encoding = require 'encoding'
local key = require 'vkeys'
local hook = require 'lib.samp.events'
local memory = require 'memory'
local ffi = require 'ffi'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local activ = false
function main()
if not isSampfuncsLoaded() or not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
sampRegisterChatCommand("asd", function ()
activ = not activ
printStringNow(activ and '~g~binder activated' or '~r~binder deactivated', 2000)
end)
while true do
wait(0)
if activ then
if wasKeyPressed(key.VK_NUMPAD2) then
sampSendChat("/udc")
end
if(wasKeyPressed(key.VK_NUMPAD1)) then
sampSetChatInputText("/usemeds ")
sampSetChatInputEnabled(true)
end
if(wasKeyPressed(key.VK_XBUTTON1)) then
screen()
end
end
end
end
function hook.onServerMessage(color, text)
if text:find("вызывает медика") then
lua_thread.create(function()
wait(100)
sampSendChat("/accept medic")
end)
end
end
function hook.onCreateObject(id, data)
if id == 1276 then
setMarker(1, data.position.x, data.position.y, data.position.z, 20, 0xFFFFFFFF)
end
end
function screen()
local rwcam = ffi.cast("void* *", 0xB6F97C)
local TakeScreenshot = ffi.cast("void(__cdecl*)(void *, const char*)", 0x5D0820) -- TakeScreenshot()
local p = "moonloader\\screens\\" .. os.date("%d.%m.%Y %H.%M.%S.png")
TakeScreenshot(rwcam, p)
end
function setMarker(type, x, y, z, radius, color)
checkpoint = addBlipForCoord(x, y, z)
marker = createCheckpoint(type, x, y, z, 1, 1, 1, radius)
changeBlipColour(checkpoint, color)
end