File size: 1,614 Bytes
d7c5875 | 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 | --[[
Project: SAMP-API.lua <https://github.com/imring/SAMP-API.lua>
Developers: imring, LUCHARE, FYP
Special thanks:
SAMemory (https://www.blast.hk/threads/20472/) for implementing the basic functions.
SAMP-API (https://github.com/BlastHackNet/SAMP-API) for the structures and addresses.
]]
local sampapi = require 'sampapi'
local shared = sampapi.shared
local mt = require 'sampapi.metatype'
local ffi = require 'ffi'
shared.require 'v037r5.CEntity'
shared.require 'v037r5.CPed'
shared.require 'CMatrix'
shared.require 'CVector'
shared.require 'v037r5.CRemotePlayer'
shared.require 'v037r5.CVehicle'
shared.require 'v037r5.Animation'
shared.require 'v037r5.ControllerState'
shared.require 'v037r5.Synchronization'
shared.require 'v037r5.AimStuff'
shared.ffi.cdef[[
typedef struct SCPlayerInfo SCPlayerInfo;
#pragma pack(push, 1)
struct SCPlayerInfo {
int pad_0;
int m_nScore;
BOOL m_bIsNPC;
int m_nPing;
SCRemotePlayer* m_pPlayer;
int __aling;
string m_szNick;
};
#pragma pack(pop)
]]
shared.validate_size('struct SCPlayerInfo', 0x30)
local CPlayerInfo_constructor = ffi.cast('void(__thiscall*)(SCPlayerInfo*, const char*, BOOL)', 0x141B0)
local CPlayerInfo_destructor = ffi.cast('void(__thiscall*)(SCPlayerInfo*)', 0x13F60)
local function CPlayerInfo_new(...)
local obj = ffi.gc(ffi.new('struct SCPlayerInfo[1]'), CPlayerInfo_destructor)
CPlayerInfo_constructor(obj, ...)
return obj
end
local Synchronization = {}
local AimStuff = {}
return {
new = CPlayerInfo_new,
Synchronization = Synchronization,
AimStuff = AimStuff,
} |