- 13
- 2
- Версия MoonLoader
- .027.0-preview
Lua:
script_name("NameTagHack")
script_author("seven.eXe")
local ffi = require "ffi"
require "moonloader"
local hackAct = false
ffi.cdef[[
struct stSAMP
{
char pad_0[44];
void *m_pRakClient;
char m_szHostAddress[257];
char m_szHostname[257];
bool m_bDisableCollision;
bool m_bUpdateCameraTarget;
bool m_bNametagStatus;
int m_nPort;
int m_bLanMode;
int m_aMapIcons[100];
int m_nGameState;
uint32_t m_lastConnectAttempt;
struct stServerPresets *m_pSettings;
char pad_2[5];
struct stSAMPPools *m_pPools;
}__attribute__ ((packed));
struct stServerPresets
{
uint8_t byteCJWalk;
int m_iDeathDropMoney;
float fWorldBoundaries[4];
bool m_bAllowWeapons;
float fGravity;
uint8_t byteDisableInteriorEnterExits;
uint32_t ulVehicleFriendlyFire;
bool m_byteHoldTime;
bool m_bInstagib;
bool m_bZoneNames;
bool m_byteFriendlyFire;
int iClassesAvailable;
float fNameTagsDistance;
bool m_bManualVehicleEngineAndLight;
uint8_t byteWorldTime_Hour;
uint8_t byteWorldTime_Minute;
uint8_t byteWeather;
uint8_t byteNoNametagsBehindWalls;
int iPlayerMarkersMode;
float fGlobalChatRadiusLimit;
uint8_t byteShowNameTags;
bool m_bLimitGlobalChatRadius;
}__attribute__ ((packed));
]]
function main()
while true do
wait(0)
if isKeyDown(VK_MENU) and isKeyJustPressed(VK_F3) then
hackAct = not hackAct
if hackAct then
nameTagDist = sampGetSampInfoPtr().m_pSettings.fNameTagsDistance
nameTagWalls = sampGetSampInfoPtr().m_pSettings.byteNoNametagsBehindWalls
sampGetSampInfoPtr().m_pSettings.fNameTagsDistance = 999.0
sampGetSampInfoPtr().m_pSettings.byteNoNametagsBehindWalls = 0
else
sampGetSampInfoPtr().m_pSettings.fNameTagsDistance = nameTagDist
sampGetSampInfoPtr().m_pSettings.byteNoNametagsBehindWalls = nameTagWalls
end
printStringNow(hackAct and "NameTagHack ~g~activated. ~w~Author: ~r~seven.eXe" or "NameTagHack ~r~deactivated. ~w~Author: ~r~seven.eXe", 2000)
end
end
end
function sampGetSampInfoPtr()
return ffi.cast('struct stSAMP**', getModuleHandle("samp.dll") + 0x26EA0C)[0] -- R4 Addr
end