function main() --this function will start when script load
while not isSampAvailable() do wait(0) end --wait for samp load
sampRegisterChatCommand('unload', cmd)
while true do
wait(0)
--code
end
end
function cmd(arg)
lua_thread.create(function()
sampSendChat('/cars')
sampSendDialogResponse(162, 1, arg - 1, nil)
wait(100)
sampSendDialogResponse(163, 1, 10, nil)
-- условие если надо
wait(100)
sampSendDialogResponse(163, 0, -1, nil)
end)
end