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

local ffi = require 'ffi'
local sampapi = require 'sampapi'
local netgame = sampapi.require('CNetGame', true)

require 'sampfuncs'

function sampGetBase()
    return sampapi.GetBase()
end

function sampGetVersion()
    return sampapi.GetSAMPVersion()
end

function isSampLoaded()
    return sampapi.GetBase() ~= 0
end

function isSampfuncsLuaLoaded()
    return sampapi.GetSAMPVersion() ~= ffi.C.SAMP_VERSION_UNKNOWN
end

function isSampAvailable()
    return isSampLoaded() and netgame.RefNetGame() ~= nil
end
jit.off(isSampAvailable, true)

isSampfuncsLoaded = isSampfuncsLuaLoaded

if not isSampfuncsConsoleActive then
    function isSampfuncsConsoleActive() return false end
end