local work = true
local sampev = require 'lib.samp.events'
function sampev.onServerMessage(color, text)
if text:find('%[Оповещение%] Ваш автомобиль .*') then
carid = text:match('%[Оповещение%] Ваш автомобиль .+%((%d+)%) был уничтожен%.')
sampSendChat('/fixmycar ' .. carid)
end
end
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
wait(1000)
sampAddChatMessage("{7B68EE}[Neddie] {ffffff}AutoSpawnCar load", -1)
sampRegisterChatCommand('228', function()
work = not work
if work then
sampAddChatMessage('{7B68EE}[Neddie] {ffffff}AutoSpawnCar [{33EA0D} ON {ffffff}]', -1)
else
sampAddChatMessage('{7B68EE}[Neddie] {ffffff}AutoSpawnCar [{F51111} OFF {ffffff}]', -1)
end
end)
sampRegisterChatCommand('229', function()
sampAddChatMessage(carid, -1)
end)
end