local state = false
local clocktd = 0
local posX, posY = 0, 0
local x, y = getScreenResolution()
function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand('setclockpos',function()
state = not state
posX, posY = sampTextdrawGetPos(clocktd)
lockPlayerControl(state)
end)
while true do
wait(0)
for i = 0, 3000 do
if sampTextdrawGetString(i):find('%d%d:%d%d:%d%d') then
clocktd = i
end
end
if state and isKeyDown(0x53) then
posY = posY + 1
end
if state and isKeyDown(0x57) then
posY = posY - 1
end
if state and isKeyDown(0x41) then
posX = posX - 1
end
if state and isKeyDown(0x44) then
posX = posX + 1
end
if isKeyDown(0x0D) and state then
state = not state
posX, posY = sampTextdrawGetPos(clocktd)
lockPlayerControl(state)
end
if posX < 0 then posX = 0 end
if posX > x then posX = x end
if posY < 0 then posY = 0 end
if posY > y then posY = y end
sampTextdrawSetPos(clocktd,posX,posY)
sampAddChatMessage('posX: '..posX..' posY: '..posY, -1)
end
end