- 120
- 20
- Версия MoonLoader
- .026-beta
Lua:
ffi.cdef[[
struct stLocalPlayer
{
struct stSAMPPed *pSAMP_Actor;
uint16_t sCurrentAnimID;
uint16_t sAnimFlags;
uint32_t ulUnk0;
int iIsActive;
int iIsWasted;
uint16_t sCurrentVehicleID;
uint16_t sLastVehicleID;
struct stOnFootData onFootData;
struct stPassengerData passengerData;
struct stTrailerData trailerData;
struct stInCarData inCarData;
struct stAimData aimData;
uint8_t byteTeamID;
int iSpawnSkin;
uint8_t byteUnk1;
float fSpawnPos[3];
float fSpawnRot;
int iSpawnWeapon[3];
int iSpawnAmmo[3];
int iIsActorAlive;
int iSpawnClassLoaded;
uint32_t ulSpawnSelectionTick;
uint32_t ulSpawnSelectionStart;
int iIsSpectating;
uint8_t byteTeamID2;
uint16_t usUnk2;
uint32_t ulSendTick;
uint32_t ulSpectateTick;
uint32_t ulAimTick;
uint32_t ulStatsUpdateTick;
uint32_t ulWeapUpdateTick;
uint16_t sAimingAtPid;
uint16_t usUnk3;
uint8_t byteCurrentWeapon;
uint8_t byteWeaponInventory[13];
int iWeaponAmmo[13];
int iPassengerDriveBy;
uint8_t byteCurrentInterior;
int iIsInRCVehicle;
uint16_t sTargetObjectID;
uint16_t sTargetVehicleID;
uint16_t sTargetPlayerID;
struct stHeadSync headSyncData;
uint32_t ulHeadSyncTick;
uint8_t byteSpace3[260];
struct stSurfData surfData;
int iClassSelectionOnDeath;
int iSpawnClassID;
int iRequestToSpawn;
int iIsInSpawnScreen;
uint32_t ulUnk4;
uint8_t byteSpectateMode; // 3 = vehicle, 4 = player, side = 14, fixed = 15
uint8_t byteSpectateType; // 0 = none, 1 = player, 2 = vehicle
int iSpectateID;
int iInitiatedSpectating;
struct stDamageData vehicleDamageData;
} __attribute__ ((packed));
]]
--что я не так делаю?
function ffispawn()
return ffi.cast('bool(__thiscall *)(struct stLocalPlayer *)', sampGetBase() + 0x3AD0)() -- error wrong number of arguments for function call
end
-- отсюда взял https://github.com/BlastHackNet/SAMP-API/blob/master/src/0.3.7-R1/CLocalPlayer.cpp
--BOOL SAMP::CLocalPlayer::Spawn() {
-- return ((BOOL(__thiscall *)(CLocalPlayer *))SAMP_ADDROF(0x3AD0))(this);
--}
Последнее редактирование: