local hook = require "samp.events"
local inv = false
main = function()
repeat wait(0) until isSampAvailable()
sampRegisterChatCommand("inv", function()
inv = not inv
sampAddChatMessage(inv and "on" or "off", -1)
end)
end
hook.onSendPlayerSync = function(data)
if inv then
local charposX, charposY, charposZ = getCharCoordinates(playerPed)
local res, car = findAllRandomVehiclesInSphere(charposX, charposY, charposZ, 50, false, false)
if res then
local res, vehid = sampGetVehicleIdByCarHandle(car)
if res then
data.surfingVehicleId = vehid
data.surfingOffsets = { -50, -50, -50 }
printStringNow('you are invisible', 1000)
end
end
end
end