File size: 947 Bytes
57a3a9f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
--[[
    Project: SF.lua <https://github.com/imring/SF.lua>
    License: MIT License
    Author: imring
]]

local sampapi = require 'sampapi'
local shared = require 'sampapi.shared'
local ffi = shared.ffi

local game = sampapi.require('CGame', true)

function sampGetMiscInfoPtr()
    return shared.get_pointer(game.RefGame())
end
jit.off(sampGetMiscInfoPtr, true)

function sampToggleCursor(show)
    game.RefGame():SetCursorMode(show and ffi.C.CURSOR_LOCKCAM or ffi.C.CURSOR_NONE, show)
    if not show then
        game.RefGame():ProcessInputEnabling()
    end
end
jit.off(sampToggleCursor, true)

function sampIsCursorActive()
    return game.RefGame().m_nCursorMode ~= ffi.C.CURSOR_NONE
end
jit.off(sampIsCursorActive, true)

function sampGetCursorMode()
    return game.RefGame().m_nCursorMode
end
jit.off(sampGetCursorMode, true)

function sampSetCursorMode(mode)
    game.RefGame().m_nCursorMode = mode
end
jit.off(sampSetCursorMode, true)