0% found this document useful (0 votes)
87 views3 pages

GTA Scripting Guide

Booster fps

Uploaded by

apaatuhya19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views3 pages

GTA Scripting Guide

Booster fps

Uploaded by

apaatuhya19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

-- by Mr_XyZz~

local imgui = require "imgui"


local sampev = require("samp.events")
local ffi = require "ffi"

ffi.cdef[[
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));
]]

encoding = require "encoding"


encoding.default = "CP1251"
u8 = encoding.UTF8

local b = {
{imgui.ImBool(false), "Turn off the opening of objects on machines /machines"},
{imgui.ImBool(false), "Turn on 3d text playback"},
{imgui.ImBool(false), "Turn off the photo of 3d texts"},
{imgui.ImBool(false), "To place all the odd skins"},
{imgui.ImBool(false), "Turn off the photo of someone"},
{imgui.ImBool(false), "Turn on auto tuning"},
}

function main()
while not isSampAvailable() do wait(0) end
server = ffi.cast('struct stServerPresets*', sampGetServerSettingsPtr())
sampRegisterChatCommand("fpb", function() imgui.Process = not imgui.Process
end)
while true do wait(0)
if b[5][1].v then
if not showNicks then
showNicks = server.byteShowNameTags
end
server.byteShowNameTags = 0
elseif showNicks then
server.byteShowNameTags = showNicks
showNicks = nil
end
end
end

function onScriptTerminate(script)
if script == thisScript() and b[5][1].v and showNicks then
server.byteShowNameTags = showNicks
showNicks = nil
end
end

function imgui.OnDrawFrame()
local x, y = getScreenResolution()
imgui.SetNextWindowPos(imgui.ImVec2(x/2, y/2), imgui.Cond.FirstUseEver,
imgui.ImVec2(0.5, 0.5))
imgui.SetNextWindowSize(imgui.ImVec2(370, 180), imgui.Cond.FirstUseEver)
imgui.Begin("HASSAN MENU", imgui.Process, imgui.WindowFlags.NoCollapse +
imgui.WindowFlags.NoResize + imgui.WindowFlags.NoScrollbar)

for i, some in ipairs(b) do


imgui.Checkbox(u8(some[2]), some[1])
end

imgui.End()
end

function sampev.onPlayerStreamIn(id, team, model, pos, rot, color, fStyle)


if b[4][1].v then
return {id, team, 7, pos, rot, color, fStyle}
end
end

function sampev.onSetPlayerSkin(id, model)


if b[4][1].v and select(2, sampGetPlayerIdByCharHandle(PLAYER_PED)) ~= id then
return {id, 7}
end
end

function sampev.onCreate3DText(idObject, color, position, distance, testLOS,


attachedPlayerId, attachedVehicleId, text)
if b[2][1].v and attachedPlayerId ~= 65535 then
return false
elseif b[3][1].v and not (text:find("����� �� ���������") or
text:find("��������� ��������")) then
return false
end
end

function sampev.onPlayerChatBubble(id, col, dist, dur, msg)


if b[2][1].v then
return false
end
end

function sampev.onCreateObject(id, data)


if b[1][1].v and data.attachToVehicleId ~= 65535 then
return false
end
end

function sampev.onSetPlayerAttachedObject(playerId, index, create, object)


if b[1][1].v and create then
return false
end
end

function sampev.onSetPlayerAttachedObject(playerId, index, create, object)


if b[1][1].v and create then
return false
end
end

function sampev.onVehicleStreamIn(id, data)


if b[6][1].v then
data.paintJob = 0
for i = 1, 14 do
data.modSlots[i] = 0
end
return {id, data}
end
end

function sampev.onVehicleTuningNotification(pId, event, vId, p1, p2)


if b[6][1].v then
return false
end
end

function sampev.onSetVehicleNumberPlate(id, text)


if b[6][1].v then
return {id, tostring(id)}
end
end

You might also like